背景全屏,左右兩邊顏色不一樣,DIV+CSS 布局

來源:互聯網
上載者:User

html {overflow-x:hidden;}<br />body{ margin:0; padding:0;}<br />#top{ width:100%; position:relative; height:50px;}<br />#content{ width:980px; margin:0 auto; background:#999; height:500px; z-index:999; position:relative; padding-top:20px;}<br />#wrapper{ height:50px; width:50%; position:relative; background:#09F; float:left;display:inline;}<br />#w_2{ height:50px; width:50%; background:#F30; float:right; *position:absolute;}<br />#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><br /> <div id="content"><br /> <div id="menu"> 導航</div><br /> 網站內容<br /> </div> 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.