Here is my HTML:
And here is my CSS:Code:<html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head <body> <div id="container"> <div id="header"> <p>header</p> </div> <div id="div1"> <p>fake div 1 text blah blah blah asdfasdfa sfdasdfasdf</p> </div> <div id="div2"> <p>fake div 2 text blah blah blah asdfasdfa sfasdfasdfa</p> </div> <div id="footer"> <p>footer</p> </div> </div> </body> </html>
I simply want the #footer to be pushed down 30px from the closest div. Why doesn't giving it margin-top: 30px; push the entire div down 30 pixels from #div1????Code:#container{ border: #999 1px solid; position: relative; width: 500px; } #header{ border: #999 1px solid; margin-bottom: 30px; } #div1{ border: #999 1px solid; float: left; width: 228px; margin: 0 10px; } #div2{ border: #999 1px solid; float: left; width: 228px; margin: 0 10px; } #footer{ border: #999 1px solid; margin-top: 30px; clear: both; } p { margin: 0; }
Thanks so much in advance.
Luke


Reply With Quote

Bookmarks