horizontal scrollbar for ul

前端 未结 5 661
忘了有多久
忘了有多久 2020-12-30 01:52

For some reason, I can\'t prevent the UL and it\'s LI\'s from wrapping. I want the UL\'s width to be exactly the width of the LI\'s on one line (without wrapping) and if the

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 02:21

    You can use display: inline-block; white-space: nowrap; for the wrapper and display: inline or display: inline-block for the children.

    So, it would look like this: http://jsfiddle.net/kizu/98cFj/

    And, if you'll need to support IE add this hack in conditional comments to enable inline-blocks in it:

    .navbuttons,
    .navbuttons LI {
        display: inline;
        zoom: 1;
    }
    

提交回复
热议问题