本文主要跟大家分享全屏自适应布局应该怎么写?青岛星网下面写了一个简单的:div+css全屏自适应布局范例代码给大家参考学习。
<div class="g-hd"> </div> <div class="g-sd"> </div> <div class="g-mn"> </div> <div class="g-ft"> </div>
/* 全屏自适应布局 */ html,body{width:100%;height:100%;overflow:hidden;margin:0;} html{_height:auto;_padding:100px 0 50px;} .g-hd,.g-sd,.g-mn,.g-ft{position:absolute;left:0;} .g-hd,.g-ft{width:100%;} .g-sd,.g-mn{top:100px;bottom:50px;_height:100%;overflow:auto;} .g-hd{top:0;height:100px;} .g-sd{width:300px;} .g-mn{_position:relative;left:300px;right:0;_top:0;_left:0;_margin-left:300px;} .g-ft{bottom:0;height:50px;}