PDA

View Full Version : preventing horizontal list from breaking



crippletoe
13 Jul 2010, 06:48 AM
Hi all, i am looking for a way to prevent a horizontal, inline unordered list from breaking into seperate lines once contained inside a element with specific width (shorter than the list). the element has "overflow" set to "hidden".

the only way i found to create that effect is by giving a specific width to the "UL" element but now, i have to create that effect for a list with unknown width!! (user can add items to list). is there any other way? it would help me so much!!

thank you all

<CrGeary.com/>
13 Jul 2010, 07:13 AM
You could use JavaScript to set the width of UL, add up all of the LI's widths together, and then set the UL width.

Or i think if you set the UL's whitespace to:

white-space: nowrap;

And put the LI's display to:

display:inline;

I think ( but im not 100% sure ), i think it might work.