Edit 2: It seems like there is some confusion about my question, so let me clarify with an example;
The area in the middle has an ID of #navigation
. Here are its CSS properties,
width: 960px;
margin: auto;
background: #e4bd04;
The width of 960px is set to keep the links in my navigation bar within a limit. I want them centered, hence the margin: auto
. However, this setup means that the background only extends for 960px. I actually want the background to cover the entire width of the window (100% of the page) to avoid large white spaces on larger screens.
To address this issue, I nested #navigation
inside another ID, #navouter
, with width: 100%
and background: #e4bd04
, giving the appearance of a full-width background.
Now, my question is, can this be achieved without using two elements as I have done?