tags:

views:

54

answers:

2

Usually, I can CSS myself out of any corner, but this Friday afternoon issue is getting to me!

Here is the problem. Mouse over the menu items (birthday, wedding, ...) and observe the dropdown.

Originally, I had these list items floating left fine. I've mucked around a lot with the CSS on the rest of the site, and since I checked them again they refused to float next to each other. They just stack up!

It works if I give them an explicit width, but I don't know from the start how wide they will be exactly (generated dynamically).

I'm looking at it on Firefox 3.6.8. The problem also occurs on Safari. I haven't tested any other browsers yet.

What am I doing wrong?

Thanks!

+3  A: 

attempt #2

white-space:nowrap; does the trick. Set it on container - #secondary-menu ul li ul. Now submenu is one long line (tried in firebug).

Pretty handy property, I might use it one day too.

Nikita Rybak
Ah yep, it would look much nicer if I did indeed want them stacked. But I don't, sorry. Thanks anyway.
alex
@alex can you clarify what "float next to each other" means? You want them in one line?
Nikita Rybak
That did the trick! I also had to remove `width: 100%`.
alex
+1 for pretty much just the last statement.
BoltClock
A: 

Using firebug, I changed the width of #secondary-menu ul li ul to 50em and it straightened out...

#secondary-menu ul li ul width appears to be calculated from a containing box somehow. But 100% of what, the data it contains? that doesn't make sense.

Try putting a div around the ul menu to be the position: absolute, and then the ul can resize inside it...

DGM
I can't give it `50em` because I want the background to only be as wide as it needs to be, not fixed. I might try your second suggestion now. Thanks for your answer.
alex
I figured that the set size wouldn't work, but it illustrates what is going wrong. I think the 100% doesn't do what you want.
DGM