背景全屏,左右兩邊顏色不一樣,DIV+CSS 佈局
阿新 • • 發佈:2019-02-12
html { overflow-x:hidden;} body{ margin:0; padding:0;} #top{ width:100%; position:relative; height:50px;} #content{ width:980px; margin:0 auto; background:#999; height:500px; z-index:999; position:relative; padding-top:20px;} #wrapper{ height:50px; width:50%; position:relative; background:#09F; float:left;display:inline;} #w_2{ height:50px; width:50%; background:#F30; float:right; *position:absolute;} #menu{ position:absolute; top:-50px; left:0; height:50px; background:#F30; width:980px;display:inline;}
<div id="top">
<div id="wrapper"></div>
<div id="w_2"></div>
</div>
<div id="content">
<div id="menu"> 導航</div>
網站內容
</div>