Sunday, 15 March 2015

Css Lists

List

In HTML, there are two types of lists:
  • unordered lists (<ul>) - the list items are marked with bullets
  • ordered lists (<ol>) - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.

Different List Item Markers

The type of list item marker is specified with the list-style-type property:

List - Shorthand property

The list-style property is a shorthand property. It is used to set all the list properties in one declaration:

When using the shorthand property, the order of the property values are:
  • list-style-type (if a list-style-image is specified, the value of this property will be displayed if the image for some reason cannot be displayed)
  • list-style-position (specifies whether the list-item markers should appear inside or outside the content flow)
  • list-style-image (specifies an image as the list item marker)
If one of the property values above are missing, the default value for the missing property will be inserted, if any.

No comments:

Post a Comment