首页 > 其他分享 >css 实现一个选项卡按钮边框弯曲平滑

css 实现一个选项卡按钮边框弯曲平滑

时间:2023-12-29 18:25:40浏览次数:30  
标签:选项卡 color 100px 边框 radius background height border css

<View class="tabs" style="display: flex; justify-content: space-between">
            <View class="tabs-item" style="width: 50%">
                <Button class="tabs-btn" :class="0 ? 'active-left' : ''" style="">Tab 0</Button>
                <View class="tabs-content"></View>
            </View>
            <View class="tabs-item" style="width: 50%">
                <Button class="tabs-btn" :class="1 ? 'active-right' : ''">Tab 1</Button>
                <View class="tabs-content"></View>
            </View>
        </View>  
.tabs {
        margin-top: 10px;
        background: #ffffff;
        .tabs-item {
            .tabs-btn {
                cursor: pointer;
                width: 100%;
                display: inline-block;
                background-color: #ffffff;
                color: white;
                text-align: center;
                transition: 0.25s ease;
                border: none;
                height: 100px;
                // padding: 20px 0;
                font-size: 34px;
                font-weight: 500;
                color: #3d3d40;
                line-height: 44px;
                border-radius: 0;
            }
            .active-left {
                background-color: #f4f5f9;
                outline: none;
                border-radius: 30px 30px 0 0;
            }
            .active-left::after {
                content: '';
                position: absolute;
                top: 0;
                right: -96px;
                height: 100px;
                width: 100px;
                background: radial-gradient(circle at 0 0, transparent 100px, #f4f5f9 100px);
                z-index: 10;
                border-radius: 0 60px 0 0;
                transform-origin: center;
                transform: rotateY(180deg);
            }

            .active-right {
                border-radius: 30px 30px 0 0;
                background-color: #f4f5f9;
                outline: none;
            }
            .active-right::after {
                content: '';
                position: absolute;
                top: 0;
                left: -96px;
                height: 100px;
                width: 100px;
                background: radial-gradient(circle at 0 0, transparent 100px, #f4f5f9 100px);
                border-radius: 0 10px 0 0;
            }
        }
    }

标签:选项卡,color,100px,边框,radius,background,height,border,css
From: https://www.cnblogs.com/yoona-lin/p/17935481.html

相关文章

  • css多行文本省略 line-clamp
    css多行文本省略line-clamp一行文本内容溢出的省略例子:<divclass="container"style="width:200px;outline:1pxsolidred"><divclass="description"style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"&g......
  • 前端那些好用的CSS/JS网站
    ......
  • CSS基础
    【CSS简介、基础选择器、字体属性、文本属性、引入方式】本文档是个人对Pink老师课程的总结归纳及补充,转载请注明出处!一、CSS简介CSS的主要使用场景就是布局网页,美化页面的。1.1HTML的局限性HTML只关注内容的语义,虽然HTML可以做简单的样式,但是带来的是无尽的臃肿、......
  • 黑马pink css8 高级
    精灵图使用核心总结:字体图标的优点和不足:利用边框构建三角形:鼠标样式:取消表单轮廓线:outline:0outline:none禁止更改文本框大小:resize:none实现图片(行内元素或行内块元素)和文本的垂直居中对齐:vertical-align:middle;解决图片底部默认空白缝隙的问题单行文本溢......
  • 你不知道的css
    图片文字环绕shape-outside是一个允许设置形状的CSS属性。它还有助于定义文本流动的区域:.any-shape{width:300px;float:left;shape-outside:circle(50%);}shape-outside属性定义了一个可以是非矩形的形状,相邻的内联内容应围绕该形状进行包装。默认情况下,内联内......
  • css+html 实现带箭头的流程步骤条
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Title</title><style>.navs{height:50px;line-height:50px;padd......
  • CSS实现滚动贴合效果
    一、滚动贴合介绍滚动贴合:鼠标滚动的时候,自动贴合到浏览器的底部或顶部设置CSS滚动贴合需要使用到两个属性:1、给滚动容器设置scroll-snap-type,值为滚动的方向和方式.container{/*display:flex;*//*第一个值为滚动贴合的方向,y表示纵向滚动贴合......
  • css+jquery右下角弹框提示框(工作需要就开发调式了)
    使用时调用:addTip();setTimeout("closeTip();",1000);setTimeout("removeTip();",2000); //添加提示框functionaddTip(){vartip="<divid='tip'>"+"<divclass='tip-header'>提示......
  • css学习知识
    CSS规则由两个主要的部分构成:选择器,以及一条或多条声明。CSS声明总是以分号;结束,声明总以大括号{}括起来。id选择器可以为标有特定id的HTML元素指定特定的样式。HTML元素以id属性来设置id选择器,CSS中id选择器以"#"来定义。class选择器用于描述一组元素的样式,可......
  • Sublime Text Html CSS JS 代码整理美化插件
    原文地址:SublimeTextHtmlCSSJS代码整理美化插件使用代码编辑编辑器的好处就是有很多功能可以用,特别是一个就是代码整理优化。在编写代码时,我们经常会遇到代码混乱、缩进不正确或格式不统一等问题。这些问题可能会导致代码难以阅读、维护和调试,降低开发效率。那么我这里说一......