There are some problems with my HTML, so I am posting the code.
The first tag is a div with id="header" . I gave it 100% width and gave it a background image.
Inside the header there is another div with id="header-contents" . I want it to be centered on the page, so I gave it a width and then margin:0 auto . It works fine with the maximum size browser, but when I increase or increase the width of the browser to half, the background of the div header starts to disappear at some point and does not fill 100% of the width.
Here's how it looks at first glance (and should always look): 
Here's what it looks like when I increase or resize the browser: 
What is the correct HTML and CSS for this? Here is the code:
<!DOCTYPE HTML> <html> <style> body { margin:0; padding:0; } .clear { display:block; clear:both; } #header { min-height:156px; width:100%; background-image:url('http://www.webdesignideas.org/images/bellevueBg.gif'); } #head-contents { width:974px; margin:0 auto; height:156px; } #header ul { margin:85px 23px 0 0; float:right; list-style-type:none; } #header ul li { display:inline; } #header ul li a { margin-left:46px; font-size:19px; color:#fff; text-decoration:none; } #header ul li a:hover , #header ul li a.active { color:#FD7600 } </style> <body> <div id="header"> <div id="head-contents"> <img src="http://t1.gstatic.com/images?q=tbn:ANd9GcRRlklPBeTiVsV7dycvDxqFyrU02d0grYf4rTUqL-2ZzGb8Qvbwimb37HgO" /> <ul> <li><a href="#" class="active">Home</a></li> <li><a href="#">Products</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> <div class="clear"></div> </div> </div> </body> </html>
Umeralonaldo
source share