Hi, I'm creating a new design for myself and I'm running into a bit of an issue. xiist.com/new/ is the site so far (won't let me post live link) As you can see the white #page div is right against the top even though margin-top is there in the css. Margin-left seems to be working fine, but margin top isn't. If anyone knows what the problem is do share. Heres the source code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <link type="text/css" rel="stylesheet" href="css/main.css" /> </head> <body> <div class="background"> <img src="images/frozentree.jpg" width="100%" height="100%" alt="" /> </div> <div id="container"> <div id="wrapper"> <div id="page"> sss<div style="background: #eeeeee;">dsds</div> </div> </div> </div> </body> </html> Code (markup): Here is the CSS: @charset "UTF-8"; /* CSS Document */ body { margin: 0; padding: 0; } .background { position: fixed; left: 0; top: 0; width: 100%; height: 100%; } #container { position: relative; z-index: 2; } #wrapper { background: #000000; width: 820px; height: 800px; margin: 100px auto; } #page { background: #ffffff; width: 800px; height: 780px; margin-top: 10px; margin-left: 10px; } Code (markup):
put a padding-top into the wrapper, this works @charset "UTF-8"; /* CSS Document */ body { margin: 0; padding: 0; } .background { position: fixed; left: 0; top: 0; width: 100%; height: 100%; } #container { position: relative; z-index: 2; } #wrapper { background: #000000; width: 820px; height: 800px; margin: 100px auto; [B][I] padding-top:10px;[/I][/B] } #page { background: #ffffff; width: 800px; height: 780px; margin-top: 10px; margin-left: 10px; } Code (markup):
Hmmm lets see you make a fixed background image that automatically sizes to the size of the browser without using some alternate techniques, oh and no javascript allowed. Also I only noticed fixed and relative positioning. Get your facts straight or piss off. And thanks for the padding suggestion guys I'll try that out.