css实现简单选项卡

2017-12-06  本文已影响0人  Roadsun
<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
上一篇下一篇

猜你喜欢

热点阅读