Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Full Width Navigation Menu if within Div

Featured Replies

Hi all,

 

Desperate for some advice if anyone can help please.

 

I'm trying to make a navigation menu full width across the screen but the menu div is contained within a mainwrapper div (with a 960px width) - the reason I had to put the menu div inside the wrapper divs was because I couldn't fix the position of the menu items (so when screen resolution was altered, the items in the menu were in different places).

 

Is this even possible to extend something full width if within a div? The background is a gradient otherwise I would consider adding the nav menu to the background image.

 

Sorry if this doesn't make much sense.

Hey ZigoJacko,

 

Interesting question, i persoanlyl have onyl doen this when you seperate the menu div outside the containing div. Having somethign go 100% width whilst contained inside a fixed width div doesn't sound possible but maybe i'll be prooven wrong.

 

Is there no reason why you cant take the menu Div out and position it absolute, i know absolute is a horrible thing to do but if you already have the site coded maybe this would be an option without recoding too much stuff.

 

Can you link me the site i wouldn't mind having a play with it.

  • Author

Hey ZigoJacko,

 

Interesting question, i persoanlyl have onyl doen this when you seperate the menu div outside the containing div. Having somethign go 100% width whilst contained inside a fixed width div doesn't sound possible but maybe i'll be prooven wrong.

 

Is there no reason why you cant take the menu Div out and position it absolute, i know absolute is a horrible thing to do but if you already have the site coded maybe this would be an option without recoding too much stuff.

 

Can you link me the site i wouldn't mind having a play with it.

 

Thanks for your reply, I tried absolute positioning but for some reason I still couldn't get the menu items to remain in the same position regardless of what resolution you viewed the site in. This was the only reason I put the menu div back inside the wrapper divs. (Sent you PM with link) - Thanks

I couldn't fix the position of the menu items

 

This seems like the main problem, and if you fix this you can just use the advice above. Why can't you fix the position of your menu items? An example of the code and the site would probably help

Edited by batgranny

I'm trying to make a navigation menu full width across the screen but the menu div is contained within a mainwrapper div (with a 960px width) - the reason I had to put the menu div inside the wrapper divs was because I couldn't fix the position of the menu items (so when screen resolution was altered, the items in the menu were in different places).

 

Is this even possible to extend something full width if within a div? The background is a gradient otherwise I would consider adding the nav menu to the background image.

 

You probably could do what you want by using min-width: 960px for the mainwrapper and min-width: 960px for the nav ul tag and min-width for each li tag, (perhaps each with a class and a different min-width) so that all the li min-widths (plus any side padding, side margins and side borders) adds up the the min-width: 960px.

 

This would let the mainwrapper and nav expand if they could but not let them go below 960px.

 

IE6 would have to have fixed widths in a conditional comment because it doesn't process min-width.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.