zoukankan      html  css  js  c++  java
  • vue切换选项卡基本样式

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            #card{
                 500px;
                height: 350px;
            }
            .title{
                height:50px;
            }
            .title span{
                 100px;
                height: 50px;
                background-color:#ccc;
                display: inline-block;
                line-height: 50px; /* 设置行和当前元素的高度相等,就可以让文本内容上下居中 */
                text-align:center;
            }
            .content .list{
                 500px;
                height: 300px;
                background-color: yellow;
                display: none;
            }
            .content .active{
                display: block;
            }
    
            .title .current{
                background-color: yellow;
            }
        </style>
        <script src="js/vue.js"></script>
    </head>
    <body>
    
        <div id="card">
            <div class="title">
                <span class="current">国内新闻</span>
                <span>国际新闻</span>
                <span>银河新闻</span>
            </div>
            <div class="content">
                <div class="list active">国内新闻列表</div>
                <div class="list">国际新闻列表</div>
                <div class="list">银河新闻列表</div>
            </div>
        </div>
        <script脚本代码>
            var card = new Vue({
                el:"#card",
                data:{
                    num: 0,
                },
            });
        </script脚本代码>
    
    </body>
    </html>
    

      

  • 相关阅读:
    P1891 疯狂LCM
    P2568 GCD
    P1516 青蛙的约会和P2421 [NOI2002]荒岛野人
    P4168 蒲公英
    P5960 差分约束算法模板
    P2024 食物链(种类并查集)
    CF1328E Tree Queries
    CF1328B K-th Beautiful String
    dij-spfa乱搞
    P1993 小K的农场
  • 原文地址:https://www.cnblogs.com/eliwen/p/12031377.html
Copyright © 2011-2022 走看看