zoukankan      html  css  js  c++  java
  • 移动端经典的flex布局

    指明父元素为display:flex;然后给子元素一个flex值就可以按各元素所占的flex比值均分

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <style media="screen">
          .tab{
            display: flex;
             100%;
            background: red;
            height: 40px;
            line-height: 40px;
    
          }
          .tab .tab-item{
            flex: 2;
            text-align: center;
          }
          .tab .tab-item:hover{
            background: blue;
          }
        </style>
        <title>d</title>
      </head>
      <body>
    
        <div class="tab">
          <div class="tab-item">
            apple
          </div>
          <div class="tab-item">
            pear
          </div>
          <div class="tab-item">
            orange
          </div>
        </div>
    
    
      </body>
    </html>
    
    

    1:2:3

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <style media="screen">
          .tab{
            display: flex;
             100%;
            background: red;
            height: 40px;
            line-height: 40px;
    
          }
          .tab .tab-item1{
            flex: 1;
            text-align: center;
          }
          .tab .tab-item2{
            flex: 2;
            text-align: center;
          }
          .tab .tab-item3{
            flex: 3;
            text-align: center;
          }
          .tab div:hover{
            background: blue;
          }
        </style>
        <title>d</title>
      </head>
      <body>
    
        <div class="tab">
          <div class="tab-item1">
            apple
          </div>
          <div class="tab-item2">
            pear
          </div>
          <div class="tab-item3">
            orange
          </div>
        </div>
    
    
      </body>
    </html>
    
    You can change the world with your heart,even a lot of changes sometimes unless you won't geiv up....
  • 相关阅读:
    FFOM_秒交易行
    FFOM_脚本源代码
    农药_挂周金币
    保存数据,父页面列表数据更新
    点击按钮不弹出新窗口
    GridView1_RowDeleting 弹出确认对话框
    判断复选框
    获取Guid
    2019 gplt团体程序设计天梯赛总结
    Codeforces Round #550 (Div. 3)E. Median String
  • 原文地址:https://www.cnblogs.com/xiongwei2017/p/6643731.html
Copyright © 2011-2022 走看看