其他分享
首页 > 其他分享> > css练手 tabs选项卡切换

css练手 tabs选项卡切换

作者:互联网

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title></title>
    <style>
        .box {
             width: 60%;
            height: 500px;
            border: 1px solid yellowgreen;
        }

        .tabs {
            display: flex;
            height: 10%;
         }

        span {
            box-sizing: border-box;
            width: 100px;
            height: 100%;
            line-height: 50px;
            text-align: center;
            border: 1px solid yellowgreen;
            border-width: 0px 1px 1px 0px;
            background-color: #fff;
            user-select: none;
        }   

        span:hover {
            border-bottom: none;    
        }

        .panel {
            margin-top: -1px;
            width: 100%;
            height: calc(100% - 10%) ;
            border-top: 1px solid yellowgreen;
            z-index: -1;
        }
    </style>
  </head>
  <body>
    <div class="box">
        <div class="tabs">
            <span>这是tab1</span>
            <span>这是tab2</span>
            <span>这是tab3</span>
        </div>
        <div class="panel"></div>
    </div>
  </body>
</html>

 

标签:练手,box,选项卡,tabs,yellowgreen,height,width,1px,border
来源: https://www.cnblogs.com/Jiaojiawang/p/15897910.html