Results 1 to 2 of 2

Thread: preventing horizontal list from breaking

  1. #1
    Join Date
    Jun 2010
    Posts
    3

    preventing horizontal list from breaking

    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

  2. #2
    Join Date
    Mar 2010
    Location
    England
    Posts
    1,144
    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:
    Code:
    white-space: nowrap;
    And put the LI's display to:
    Code:
    display:inline;
    I think ( but im not 100% sure ), i think it might work.

Similar Threads

  1. Problems with list <ul> sub <ul> list
    By ehart in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 08 Mar 2010, 01:52 PM
  2. difficulty with horizontal list for navigation bar
    By oboedrew in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 20 May 2008, 04:33 AM
  3. Creating multiple dynamic list boxes from mysql database
    By phoenix211984 in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 26 Sep 2006, 07:26 PM
  4. Ordered List Question
    By Gage8 in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 16 Dec 2005, 02:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •