- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am wanting to wrap all my content within one main wrapper div. Here’s the problem, I only want my main content to be within a Div with a width of 1040px, but I want the navigation bar to have the width of 100% so that it expands the user’s full screen/resolution.
Any suggestion? If you can help me out it would be much appreciated. Also, I hope I explained it right.
Thank you
One possibility would be to absolutely position the navigation and set it’s width to 100%. An example of what you’re trying to achieve would be helpful. It may be possible to use a background image to give the impression that the navigation extends to the edges, but it depends on your particular situation.
If you’re going to use absolute positioning just to save 1 less div..crazy man.
What does your layout look like?
I don’t think the question was about saving a div. I assume his layout is something similar to:
Of course, it’s possible to create two wrapper divs to separate out the nav, but who knows, maybe he has to work with someone else’s HTML, or maybe he just doesn’t want to change the HTML.
In any event, if absolute positioning works, there’s no reason not to use it. Whether you add a couple lines of CSS for the AP or a few lines for the extra div in markup, it’s up to you. Personally, I prefer to make design changes in the CSS if I can help it.
Hi,
If you want to set nav as 100% width then follow below steps,
1. Use position relative in warpper div.
2. give position absolute to nav div and set top and left in pixel as you want to show your nav div in 1040px layout.
Try it and let me know :)