DHTML/CSS Menu??

Advertisement


Question
Hi Andrew,

I was wondering if you could answer a CSS question for me. I found a cool horizontal css menu:

http://www.projectseven.com/tutorials/navigation/auto_hide/

And I tried to use it on my site:

http://thehotelchelsea.com/allie/

It seems like I can't get the little menu bar to stay in the right place. When I seem to have it right in Firefox (on a MAC) my friends who have PCs say that they see it funny so I'm starting to feel helpless.

Is this kind of menu impossible for cross-browser purposes? Ideally I had wanted to make something like this:

http://www.ikies.com/overview.html

Thank you so much if you can help me!!

Allie

Answer
Allie,
I'm not certain what this will do to Firefox Mac, but try adding the following CSS properties to what's already there.  Just add the properties (e.g., position: relative--not the whole surrounding CSS rule).


/* line 177 */
#p7menubar li {
position: relative;
}

/* line 119 */
#p7menubar li ul {
top: 75px;
}

Basically, this says:

Give the list items holding the initially invisible drop-down lists a relative position.  This gives the absolutely positioned invisible drop-downs some context.  Now, these hidden lists are absolutely positioned with respect to their relatively positioned parents (the first-level list items).  This is working in Firefox Windows, so hopefully it won't break the Mac version.

DHTML

All Answers


Answers by Expert:


Ask Experts

Volunteer


Andrew Hoffman

Expertise

Ask me about JavaScript, CSS, HTML5/XHTML, or PHP. Chances are I'll be able to help you. I know the economy is in the tank, but if you like my answer, please consider donating a few bucks. It's like tipping your barista, if your barista served fresh code instead of coffee.

Experience

I started doing this when boy bands were still cool.

Education/Credentials
I read a lot of nerdy books to get here.

©2012 About.com, a part of The New York Times Company. All rights reserved.