zoukankan      html  css  js  c++  java
  • css 如何实现右边div高度随着左边div内容的增加,右边div的高度也增加(如何是左边div与右边div高度保持一致)

    <template>
      <div class="indexOne">
         <div class="nav_info">
    
           <div class="left_info">44444444444444444444444446666666666666666666666686666666666666666666666666666666
             666666666666666666666666666666666666666666666666666666666666666666666
             66688888888888888888888888888888888888888888888888888888888888889
             999999999999999999999999999999999999999999999999999999999999999999999
             99999999999999966666666666666666666666666666666666666666666666666666666666666669</div>
           <div class="right_info"></div>
         </div>
      </div>
    </template>
    
    <script>
    export default {
      name: 'indexOne',
      components: {
       
      },
      created () { 
      
      }
    }
    </script>
    <style lang="scss" scoped>
    .indexOne{
       100%;
        height:400px;
        text-align:center;
      .nav_info{
          100%;
            height: auto;
            background-color: aquamarine;
            // display: flex;
            position: relative;
        .left_info{
            30%;
            height:auto;
            background-color: aqua;
            line-height: 25px;
        }
        .right_info{
          position: absolute;
            top: 0;
            right: 0;
             70%;
            height: 100%;
            background-color: bisque;
        }
      }
    }
    </style>
    

      方法2.利用display:table

      

    <style lang="scss" scoped>
    .indexOne{
       100%;
        height:400px;
        text-align:center;
      .nav_info{
             100%;
            display: table;
             display: table-row;
        .left_info{
          display: table-cell;
          vertical-align: middle;
           30%;
          height:auto;
          background: rosybrown;
          line-height: 30px;
        }
        .right_info{
          display: table-cell;
          vertical-align: middle;
           70%;
          background: greenyellow
        }
      }
    }
    </style>
    

      

  • 相关阅读:
    poj2976 Dropping tests (01分数规划)
    bzoj5281/luogu4377 Talent Show (01分数规划+背包dp)
    bzoj5280/luogu4376 MilkingOrder (二分答案+拓扑序)
    bzoj1492/luogu4027 货币兑换 (斜率优化+cdq分治)
    [模板]树状数组
    匿名函数 python
    yield解析你要知道的源自IBM
    stackoverflow yield 帖子
    pandas 生成器,生成大数据
    pd.contact,dataframe 拼接
  • 原文地址:https://www.cnblogs.com/cyf-1314/p/13740770.html
Copyright © 2011-2022 走看看