div高度占满整个屏幕

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>div高度占满整个屏幕</title>
    <style type="text/css">
     .main {
         padding: 0;
         margin: 0;
         position: absolute;
         left: 0;
         top: 0;
         bottom: 0;
         right: 0;
         background: red;
     }
    </style>
</head>

<div class="main">
    
</div>
</body>
</html>
    原文作者:小渝人儿
    原文地址: https://segmentfault.com/a/1190000003991226
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞