tags:

views:

384

answers:

2

I am building a menu with horizontal main entries. Below each the corresponding submenu titles are displayed vertically. Now, some longer menu titles are wrapped over several lines. Actually, the "sub" UL is just as wide as the longest single word in a submenu and all others are wrapped accordingly. I have given no width for the UL nor the LI (neither main nor sub menu).

So my question is, how can I avoid breaking lines? Probably I could substitute each space with  , but is there a different way to achieve this?

+3  A: 

Have you tried styling the li with

white-space: nowrap

?

Eifion
+4  A: 

Hi, adding the following CSS will prevent the line from breaking:

li {
   white-space: nowrap;
}
Wayne Austin
Thank you. This was exactly what I was looking for!
Martin