频道栏目
首页 > 资讯 > HTML/CSS > 正文

css3实现选项卡小三角形状

17-07-01        来源:[db:作者]  
收藏   我要投稿

效果如下图查看链接

这里写图片描述

html

<div class="fitting-tab">
    <div class="fitting-text  fit-active" id="btn1">
        <div class="trangle "></div>
            推荐              
    </div>
    <div class="fitting-text " id="btn2">
        <div class="trangle "></div>
            男装              
    </div>
    <div class="fitting-text " id="btn3">
        <div class="trangle "></div>
            女装              
    </div>
    <div class="fitting-text " id="btn4">
        <div class="trangle "></div>
            套装              
    </div>
</div>



css 样式 (核心部分)

.fitting-tab .fitting-text{
    width:80px;
    height:30px;
    background:red;
    position: relative;
    text-align:center;
    line-height:30px;
    background-color:#AF8172;
    color:#fcfcfc;
    font-size:16px;
    border-radius:6px;


}

.fitting-tab .trangle{
    position: absolute;
    width: 0;
    height: 0;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
    border-top: 5px solid #AF8172;
    z-index: 99;
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
    }
相关TAG标签
上一篇:云服务器配置web环境
下一篇:ajax异步加载实现局部刷新
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站