Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Forcing overflowing floats onto one line

Forcing overflowing floats onto one line

Scheduled Pinned Locked Moved Web Development
helpdocker
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hxhl95
    wrote on last edited by
    #1

    Hiya everyone, I have a dynamically generated (using the innerHTML property) set of list items that're floated into a 4-column list like follows:

    <ul>
    <li style="width:40%">text</li>
    <li style="width: 20%">text</li>
    <li style="width: 30%">text</li>
    <li style="width: 10%">text</li>
    </ul>

    The container that this list is in has to be able to dynamically resize. I've added overflow:auto to add scrollbars when the content in the box overflows. BUT, when the container is resized small enough, instead of having a horizontal scrollbar (the vertical one works fine) the rightmost <li> gets pushed down to the next line instead of staying on one line with the other 3 <li>s and overflowing off the side of the window, making a scrollbar appear. I've already tried white-space:nowrap in half a dozen places. Refuses to work. I can't use a table either, as dynamically writing a table causes a runtime error in IE and I want this code to be as compatible as possible. Any help would be greatly appreciated (note the extreme emphasis on greatly)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups