• 垂直居中



    <div class="wrap"> 1211111 </div> <div class="wrap"> <img src="images/stars.png" alt=""> </div> <div class="wrap"> <div class="a"></div> </div> .wrap{ 500px;padding: 20px 0;} 父元素高度不确定,
    父元素高度确定的垂直居中
    方法一 <table> <tr> <td> <div>112</div> <div>112</div> <div>112</div> <div>112</div> </td> </tr> </table> td的vertical-align默认middle,不用设置 td{ 300px;height: 300px;}

    方法二
    <div>
      <span>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</span>
    </div>

    div {
    250px;
    height: 100px;
    line-height: 100px;
    text-align: center;
    border:1px solid red;
    }

    span {
    display: inline-block;
    vertical-align: middle;
    line-height: normal;
    100%;
    word-wrap: break-word;
    text-align: left;
    }

      

  • 相关阅读:
    053-1
    多项式ADT笔记(数据结构c版)
    052-188
    052-187
    052-186
    052-185
    052-184
    052-183
    052-182
    JS中的垃圾回收(GC)
  • 原文地址:https://www.cnblogs.com/wz0107/p/5054098.html
Copyright © 2020-2023  润新知