Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Unordered Lists

  • 22-09-2009 4:33pm
    #1
    Closed Accounts Posts: 26


    I have created a unordered list with each item being a link, but have been unable to increase the space between each item on the list (vertically). At the moment it looks like the spacing below. I want to basically create a space of about 30px between each item.
    • Item 1
    • Item 2
    • Item 3
    How do I create the space? The list is enclosed in a div.
    Im sure this is very simple but I would appreciate any input.
    Thanks:)
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 742 ✭✭✭Pixelcraft


    add padding to the <li> with css


  • Registered Users, Registered Users 2 Posts: 436 ✭✭Kila


    You could apply a style to the list or the list items and add padding/margin around them to increase the space.

    e.g.
    .li spaced{
    padding-bottom:30px;
    margin-bottom:30px;
    }

    Then either have the list items call their class (<li class="spaced">) or create an overall class for the ul and have the li styling inherited.


  • Closed Accounts Posts: 1,200 ✭✭✭louie


    kila is going the right way but there is a wrong typo in the code.

    My way
    give the ul an id and style the li inside by adding padding to it
    <ul id="my_ul">
        <li>LINK</li>
        <li>LINK</li>
    </ul>
    

    and now style the li using CSS
    #my_ul{margin:0px; padding:0px}/* this is the ul id */
    /*now the li style */
    #my_ul li{padding:3px 0px 3px 5px;/*top,right,bottom,left*/}
    


Advertisement