height - Specific css positioning / dynamic width with auto margin -
made image better understanding of problem.
need code .bgimage , .content div
is possible crossbrowser css (ie7+ , other major browsers) without scripting?
it bit longer expected, got picture in real life. don't ask again questions here without doing more research first , writing actual code.
the code
html:
<body> <div id = "header"> </div> <div id = "bgimage"> </div> <div id = "content"> </div> <span class = "clear"></span> <div id = "footer"> </div> </body>
css:
* { margin: 0; padding: 0; } body { width: 960px; margin-left: auto; margin-right: auto; } #header { width: 100%; height: 200px; background-color: purple; } #bgimage { position: absolute; top: 200px; left: 0px; right: 50%; height: 600px; background-color: green; } #content { position: relative; width: 700px; height: 600px; float: right; z-index: 2; background-color: blue; } .clear { clear: both; } #footer { position: relative; top: 600px; width: 100%; height: 200px; background-color: red; }
note: haven't optimized css, there's work done there.
explanation
elements i've used in code (you might want google them):
- css reset
- css clear
- absolute positioning css
- relative positioning css
Comments
Post a Comment