html - How to make Div expand width with 100% -


i had make container , make middle width margin: 0 auto, had face problem make content width fit window width 100% width?

any way make it?

if using padding:0 400px , margn-left:-200 ?

here working code.

css

html, body {width:100%; height:100%; background:lightblue} * { margin:0; padding:0} #container {    width:1024px;   min-height:100%;   background:red;   margin:0 auto;   position:relative;  }  header {    width:100%;   height:80px;   background:skyblue; }  header ul {list-style-type:none; float:right} header ul li {display:inline-block; padding: 10px; 20px;}  #content {   width:100%;   height:200px;   background:yellow;   padding:0 300px;   margin-left:-200px; } 

http://codepen.io/jaminpie/pen/chrif

thansk help..

move content div outside of container, give absolute positioning 80px top falls right below header.

#content {   width:100%;   height:200px;   background:yellow;   padding:0 300px;   position:absolute;   top:80px; } 

updated pen


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -