Full width expanding div using 960 grid system?
How do you get a div that expands to the full size of the browser (no matter how you resize) while working with the 960 grid system? I can only think of something like this - but I d开发者_如何学Con't like it because what if you have a background for the container_24 then you'd have to set it two times. The point is, I want everything else working under the container_24 even the text inside the full expanding div.
<div class="container_24">
<!-- stuff -->
</div>
<div style="width: 100%; background-color: gray;">
<div style="margin: 0 auto; width: 940px;">
Hello
</div>
</div>
<div class="container_24">
<!-- more stuff -->
</div>
Putting a z-index
value on both the container and expanding div and having the z-index
value for the expanding div larger than the container will lift it out. You then need to set the position
of the expanding div to absolute
and then it will expand out of the container. I'm sure there are some cases where this won't work/cut it though.
精彩评论