Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Horizontal scrolling inside

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38519
    XaviJr
    Participant

    http://jsfiddle.net/tTuaF/7/

    The example is clear. I want to have an horizontal scroll in the ol but the 3 is going down.

    #104457
    yinzdo
    Member

    Surround the ordered list with a wrapper:




    1. 1

    2. 1

    3. 1



    Remove overflow: auto from the ordered list and add it to the wrapper. Make sure the wrapper has a fixed width:



    .wrapper {
    overflow: auto;
    width: 30px;
    }

    ol {
    width: 30px;
    }

    li {
    display:inline-block;
    }

    The wrapper should now act as a window within which the ol will scroll.

    #104460
    Meta_Ing
    Participant

    You can add white-space:nowrap; to the ol block to prevent the text from wrapping.

    #104461
    yinzdo
    Member

    @Meta_Ing much more elegant your way :)

    #104534
    XaviJr
    Participant

    @Meta_Ing your solution worked, thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.