码迷,mamicode.com
首页 > 其他好文 > 详细

绝对定位居中布局

时间:2017-09-04 21:22:47      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:tle   htm   nbsp   ext   head   auto   log   div   pre   

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            html,
            body {
                height: 100%;
            }
            
            .div {
                position: absolute;
                /*height: 200px;*/
                width: 800px;
                background: yellow;
                margin: 0 auto;
                top: 0;
                left: 0;
                bottom: 0;
                right: 0;
                /*margin-top: -100px;*/
            }
        </style>
    </head>

    <body>
        <div class="div"></div>
    </body>

</html>

 

绝对定位居中布局

标签:tle   htm   nbsp   ext   head   auto   log   div   pre   

原文地址:http://www.cnblogs.com/lhl66/p/7475538.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!