Results 1 to 7 of 7

Thread: How do I make each <li> appear on the same line?

  1. #1
    Join Date
    Oct 2008
    Location
    Brooklyn, NY
    Posts
    27
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How do I make each <li> appear on the same line?

    How do I create an unordered list in which each <li> appears on the same line instead of separate lines? Is there CSS code I can use? Attribute?
    Last edited by Snookerman; 04-22-2009 at 08:57 AM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    li {
    display:inline;
    }

  3. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Float them left using css:
    Code:
    li {
    float:left;
    }

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by bluewalrus View Post
    li {
    display:inline;
    }
    Or use this, but then you lose the bullet points. Depends what you want.

  5. #5
    Join Date
    Oct 2008
    Location
    Brooklyn, NY
    Posts
    27
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Thanks guys. I tried both ways but it's still not working. Can you correct my code? (http://americanchic.net/testpage)

  6. #6
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You need to float the images as well:
    Code:
    #myul li{margin:0px;float:left;}
    #myul img{
    float:left;
    border:1px solid #222;
    width:80px;
    height:67px;
    cursor:pointer;
    }

  7. The Following User Says Thank You to Snookerman For This Useful Post:

    jihanemo (11-03-2008)

  8. #7
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    By the way, make sure you mark this thread as Resolved by editing your first post and adding the Resolved prefix.

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
  •