/    Sign up×
Community /Pin to ProfileBookmark

Can’t center CSS-driven dropdown menu

Hi, guys.

I have a very basic two-level CSS-driven dropdown menu that I can’t get centered on the page.

[URL=”http://www.eventidewebdesign.com/public/test2.html”]Here’s the page[/URL].

It won’t center in either IE8 or FF3.6

I’ve been searching the web for ideas/solutions for several hours now and have tried a number of different things.

I’m suspecting it has something to do with the styling in the menu itself, but I can’t figure out what’s preventing it from getting centered.

I’d like to stick to a standards-compliant solution if at all possible, but I’ll do what I need to do to make it centered…

Thanks for anyone’s help!

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelMay 19.2010 — #navbar { font-size: larger; }

give this a "width:835px;" and "margin:0 auto;"

This will 'center' the 'width' in the available space by using equal values of 'auto' left and right of the UL

[I]You will need a valid !doctype[/I] (which you already have) [I]to make this work, else IE messes it up..[/I]
Copy linkTweet thisAlerts:
@eventideauthorMay 20.2010 — Thanks a lot, Joel. One of these days I'm going to get these little browser/CSS quirks down!

I'm wondering, though why you specified a width of 835px. How did you come to that number?
×

Success!

Help @eventide spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...