Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Centering Drop Downs in a Menu Bar

CSS troubles with centering and display



4:05 pm on Apr 1, 2003 (gmt 0)

10+ Year Member

Dumb question I'm sure, bear with me.

I'm making a menu bar with several drop down menus using CSS. I want this menu bar to be centered within the browser regardless of resolution, but when I center it, the drop downs display behind the content. The only way I've been able to get it to display above the content is to set it's position to absolute, but then I can't get it to center.

Am I missing something dumb here? Do you have to set your position to absolute to make the z-index work? If so, how do I use absolute positioning to center regardless of resolution?


4:29 pm on Apr 1, 2003 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi rdoyle720,

There are two ways of centering a layer on a page, using javascript to read the available width of the page and dynamically writing the left: value; or using CSS itself! The latter was discussed recently here [webmasterworld.com].


Featured Threads

Hot Threads This Week

Hot Threads This Month