I am creating a fix layout (960px wide) for my web-template. But I want my menu-bar’s width as the width of the browser (which means, as wide as possible without margins).
CSS for body :
body{
width:960px;
min-width:960px;
margin:auto auto;
}
How can i do that ?
A layout like this : http://www.google.com/analytics/index.html
(notice the fixed width of body and the menu bar is wider than that)
What I think you want is to have your content in the 960px region centered, but have the ability to have other content (your menu in this case) that can be the full size of the page. To be able to do that, you can’t have the width of the body itself set like you do. Instead, you should have some HTML like:
Then in your CSS:
As for the Google Analytics site, they have separate sections of the page at full width, with the color, borders, etc. defined, then a region just like #ContentBox I described above in each section. You can even make it a common class and reuse it, like:
CSS: