Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2006
    Location
    Bahrain
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Every list should not have line breaks

    May I ask how to make every list have no line breaks?
    (And let me show you here) :
    • 1
    • 2
    • 3

    I usually use list-style-type: none but it just remove the lists at left of them.
    Now, how could we do it?
    ALWAYS remember to validate your code

  • #2
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    How about this:
    Code:
    li {
      display: inline;
      float: left;
    }

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inline or float

    That's a bit double, and unnecessary: use either display: inline or float: left. Besides, if I recall correctly floating an element makes it block level by default.
    If you use float, by the way, the spacing between the list items can be controlled using margins/padding; inline elements don't render left and right margins/padding.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    how embarassing... lol. Thanks ronaldb66.
    However, I do believe that margins apply to inline elements, although only the left and right margin has any effect. This was clarified by Arbitrator here.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Intricacies

    No sweat; CSS has many tricky little details which often aren't immediately appearent, or clear for that matter. One can keep learning about this stuff--until the new version becomes available, and then it all starts again.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

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