Thursday, January 9, 2014

CSS Lists

CSS Lists

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters

 Crossbrowser Solution

The following example displays the image-marker equally in all browsers:
ul
{
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul li
{
background-image: url();
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 15px;
}

 CSS List Properties

 Property     Description
list-style     Sets all the properties for a list in one declaration
list-style-image     Specifies an image as the list-item marker
list-style-position     Specifies if the list-item markers should appear inside or outside the content flow
list-style-type     Specifies the type of list-item marker

No comments:

Post a Comment