En HTML, tenemos dos tipos de listados:
Con CSS, también podemos usar imágenes.
The type of list item marker is specified with the list-style-type property:
ul.a {list-style-type: circle;}
ul.b {list-style-type: square;}
ol.c {list-style-type: upper-roman;}
ol.d {list-style-type: lower-alpha;}
ul
{
list-style-image: url('sqpurple.gif');
}
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(sqpurple.gif);
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 14px;
}
Example explained:
It is also possible to specify all the list properties in one, single property. This is called a shorthand property.
The shorthand property used for lists, is the list-style property:
ul
{
list-style: square url("sqpurple.gif");
}
When using the shorthand property, the order of the values are:
It does not matter if one of the values above are missing, as long as the rest are in the specified order.
All the different list-item markers for lists
This example demonstrates all the different list-item markers in CSS.
Ejercicio