This is my first post woo hoo! I need HELP on centering this Vertical Drop Down Menu both horizontally **and** Vertically for all screen resolutions?
**[See CSS CODE Stylesheet](http://differentregard.com/css/homebg.css “homebg.css”)
**[Here is what the Menu looks like on the Website](http://www.differentregard.com/home.php “Home Menu CSS Issue”)
font-family: Century Gothic, sans-serif;
I’ve been told to make it absolute. Sigh, right now either the menu moves up or down the larger the screen resolutions gets. Do I need to center the transparent bar too?
First: what should happen when you click on the first item? A submenu shows up but the dark bar in the middle doesn’t expand with it. Not sure if that’s what you intend or not.
And yes, to center an element on page both horizontally and vertically, you’ll need the dimensions (fixed) and position it absolutely. A bit like this:
margin-top: -70px /* half the height, negative */
margin-left: -170px /* half the width, negative */
Thank you Senff. What would the actual code be for the 280 width of my current menu?
NOOB ALERT* And no I didn’t mean for that transparent bar not to extend with the drop down. LOL how can I change that?
@80sbaby: yea in your case 280 pixels. But you can make it smaller too, basically you just need the width that’s needed to contain all elements.
I’d also remove padding from #nav, by the way.
And of course — the #nav will be positioned absolutely, relative to any containers that are positioned relative. In this case, the clearbar.
You must be logged in to reply to this topic.