沐若清辰
人生如茶,浓也好,淡也好,各有味道
<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{
   width:100%;
    height:400px;
    text-align:center;
  .nav_info{
     width: 100%;
        height: auto;
        background-color: aquamarine;
        // display: flex;
        position: relative;
    .left_info{
       width: 30%;
        height:auto;
        background-color: aqua;
        line-height: 25px;
    }
    .right_info{
      position: absolute;
        top: 0;
        right: 0;
        width: 70%;
        height: 100%;
        background-color: bisque;
    }
  }
}
</style>

  方法2.利用display:table

  

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

  

posted on 2020-09-27 17:31  沐若清辰  阅读(681)  评论(0编辑  收藏  举报