SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    list style button and list item

    I am trying to keep the list button and its item together in a display inline list.
    So if the list has to fit on multiple lines, it breaks at the end of the item and not at the button item, eg.
    List appears as:
    *one *two *three *
    four * five

    but what I would like is:
    *one *two *three
    *four *five

    Is there any way to accomplish this through css?

    CathyM

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2006
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    display: inline-block;
    achieved the result.

  3. #3
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    To get it working in IE you'll need to add two extra lines (if you're not using conditional-comments to call an IE stylsheet).

    ul li {
    display: inline-block;
    }

    * html ul li {display: inline;} /*this one's for IE6*/
    *+html ul li {display: inline;} /*this one's for IE7*/

    IE8 can do inline-block on block elements like li's no problem.

    IE 6 and 7 don't need those extra lines if the element in question was already an inline element.


Bookmarks

Posting Permissions

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