SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    [li] too much spacing list-style-type graphic and text

    I have a list that has the style "list-style-type: disc" and text between the list item tags.

    The spacing between the disc and the text is too much and i want to cut it down.

    How can i do this? I can't get this to happen.

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,107
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Hello,

    padding on the li elements.

    Code:
    #list {
     list-style-type: disc;
     }
    #list li {
      padding-left: 50px;
    }
    
    <ul id="list">
      <li>asdf</li>
      <li>asdf</li>
      <li>asdf </li>
    </ul>

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks, i specified 0px padding-left and i'm rid of the spacing now.
    Weird though, because i never specified that spacing and when i tested the default behavior there was no spacing (not the extra spacing i had). I guess i must be overlooking something.

    Anyway, thanks for bringing that property to my attention.

  4. #4
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally would never use list-style-img, as I have found cross-browser that there is varied spacing between the actually list images and the text for each list element - therefore I would advise to use a bg img for each list item and put some left padding on it

    Hope this helps

    James

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm not using that, by graphic i ment the symbol that list items can have e.g. disc or decimal.

  6. #6
    SitePoint Guru redhillccwebmas's Avatar
    Join Date
    Jun 2005
    Posts
    989
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha, sorry mate - mis-read your question


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
  •