Similar to stackoverflows header, I am trying to make my header background color expand and take over both sides of the page while still keeping the text in the center but I’m not sure of the correct technique on how to do this using the 960grid system. This is my html:
<body>
<div class="container_24">
<div id="header-top-border" class="grid_24"></div> # take over top of page.
<div id="header-background" class="grid_24"></div> # take over top of page.
<div id="logo" class="grid_5">
<h1>Logo</h1>
</div>
</div>
</div>
I would like have the Logo be on top of the header-background and judging by the css on this site I’m not sure if it should be inside of the header-background div or not. How is this done?
Thank you.
You want to put the
header-backgroundoutside of thecontainer_24div, because the latter acts as a wrapper restricting the width of the usable page. If you want the logo to go on top of theheader-background, you can put it insideheader-background, or you can put it outside and shift it on top using negative margins, absolute positioning and z-index. Probably best to just put it insideheader-background.Your code might look like this: