美文网首页
css实现简单选项卡

css实现简单选项卡

作者: Roadsun | 来源:发表于2017-12-06 16:12 被阅读0次
<ul class="box">
    <li >
        <a href="#">
          first
        <div class="drop-box">
            Tab Control 1<br>
            早上好
        </div>
        </a>
    </li>
    <li >
        <a href="#">
            second
        <div class="drop-box" style="margin-left: -150px">
            Tab Control 2<br>
            中午好
        </div>
        </a>
    </li>
    <li >
        <a href="#">
            third
        <div class="drop-box" style="margin-left: -300px">
            Tab Control 3<br>
            晚上好
        </div>
        </a>
    </li>
</ul>
        .box{
            display: block;
            height: 50px;
        }
        .box li{
            display: block;
            list-style: none;
            float: left;
        }
        .box li a{
            display: block;
            background-color: #2aabd2;
            height: 50px;
            width: 150px;
            text-align: center;
            line-height: 50px;
            font-size: 25px;
            text-decoration: none;
        }
        .drop-box{
            display: none;
            border: solid 1px black;
            width: 448px;
            height: 100px;
        }
        .box li a:hover{
            background-color: #4cae4c;
        }
        .box li :hover .drop-box{
            display: block;
        }
Tab.gif

相关文章

网友评论

      本文标题:css实现简单选项卡

      本文链接:https://www.haomeiwen.com/subject/ibhlixtx.html