zoukankan      html  css  js  c++  java
  • display: table-cell; 元素上下左右居中,子元素无宽高

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style type="text/css">
                *{
                    margin: 0 ;
                    padding: 0;
                }
                
        </style>
    </head>
    <body>
    <style type="text/css">
            body{
    
                width: 100vw;
                height: 100vh;
                display: table-cell;
                vertical-align:middle;
                text-align: center;
            }
            div{
                display: inline-block;
            }
    
        </style>
    
            <div class="child">            
                内容 内容 内容 内容 内容 内容 内容 内容 内容
            </div>
    </body>
    </html>
  • 相关阅读:
    git
    读后感
    总结
    封装,策略,Asp换脸
    典型用户
    第四次作业
    第三次作业
    计算
    感悟
    对git的认识
  • 原文地址:https://www.cnblogs.com/jinsuo/p/6933856.html
Copyright © 2011-2022 走看看