• March 11, 2012
  • Category: 
  • 3 Comments

Lists are extremely important whether you are designing for print, or the web. On the web, lists are one of the fundamental elements that make your website's information organized. For the most part, lists of links are used for navigation. In this tutorial though, we will simply talk about how to style lists themselves.

Styling Lists

If you take a normal list, created in html, you can style the list in several different ways using CSS. You can decide on the different shapes available as the bullet points for each list item. The different choices are disc, circle, square, decimal, lower-roman, upper-roman, lower alpha, upper-alpha and none. Here are a couple of examples, and their CSS:

The HTML

<ul id="menu">
<li>Love
</li>
<li>Hate
</li>
<li>Work
</li>
<li>Play
</li>
</ul>

Square

#menu li {
list-style-type: square;
}

Upper-Roman

#menu li {
list-style-type: upper-roman;
}

Multi-Level Lists

Using these properties will allow you to create multi-level lists that really organize and break down your key points on your websites. For example, you can use one style for a top-level list, and for each subcategory that you have, you can use a different list style. Here is a realistic example:

The HTML:

<ul>
<li>Love
<ul id="menu">
    <li>Happiness</li>
    <li>Emotions</li>
    </ul>
</li>
<li>Hate
<ul>
    <li>Fear</li>
    <li>Shame</li>
    </ul>
</li>
<li>Work
<ul>
    <li>Jobs</li>
    <li>Careers</li>
    </ul>
</li>
<li>Play
<ul>
    <li>Retirement</li>
    <li>Recreation</li>
    </ul>
</li>
</ul>

The HTML is structured so that each list item has two subcategories. You do this by adding another unordered list inside of each top-level list item tag. You can do this multiple times to break down lists into multiple subcategories, with a different style for each level.

The CSS:

#menu li {
list-style-type: square;
}
#menu li li{
list-style-type: upper-roman;
}

The Result:

Recommended Reading

Comments

lepet's picture

lepet

good tutorial

March 13, 2012

rowcorl's picture

rowcorl

greatdisplay

July 15, 2012

bunga's picture

bunga

very nice tutor, simple and understandable
ty

January 14, 2013

Leave a Comment

Before you comment please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd><li><p><div><h1><h2><h3><h4>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.