CSS Reference

"list-style-type" - css property (v. css 1)

  • To specify the type of list-item marker.
  • Initial value: disc on first list level. On the next two list levels UA uses normally circle and square
  • The property is inherited
  • HTML usage: elements with 'display: list-item'
  • Browsers that support the list-style-type - property :
    Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari

Possible list-style-type values:

Values Comments CSS
disc Specified a disc. The rendering depends on the user agent. 1
circle Specified a circle. The rendering depends on the user agent. 1
square Specified a square. The rendering depends on the user agent. 1
decimal Decimal numbers, beginning with 1. 1
lower-roman Lowercase roman numerals (i, ii, iii, iv, v, etc.). 1
upper-roman Uppercase roman numerals (I, II, III, IV, V, etc.). 1
lower-alpha Lowercase ascii letters (a, b, c, ... z). Remember that after 26 list items this rendering is undefined. 1
upper-alpha Uppercase ascii letters (A, B, C, ... Z). Remember that after 26 list items this rendering is undefined. 1
none This value specifies no marker. 1
decimal-leading-zero Decimal numbers padded by initial zeros (e.g., 01, 02, 03, ..., 98, 99). 2
lower-greek Lowercase classical Greek alpha, beta, gamma, ... (α, β, γ, ...) 2
lower-latin Lowercase ascii letters (a, b, c, ... z). Remember that after 26 list items this rendering is undefined. 2
upper-latin Uppercase ascii letters (A, B, C, ... Z). Remember that after 26 list items this rendering is undefined. 2
armenian Traditional uppercase Armenian numbering. 2
georgian Traditional Georgian numbering (an, ban, gan, ..., he, tan, in, in-an, ...). 2
inherit Will inherit the value from parent specification. 2

Property "list-style-type" example:

<!DOCTYPE HTML >
<html>
  <head>
    <style   type="text/css">
      div {width: 300px;}
      .o1 {
        list-style-type: upper-roman;
      }
      .u1 {
        list-style-image: url(images/Marker.png);
        list-style-position: inside;
      }
    </style>
  </head>
  <body >
    <div>
      Possible list-style properties
      <ol class="o1">
        <li>list-style-images</li>
        <li>list-style-position</li>
        <li>list-style-type</li>
        <li>list-style
          <ul class="u1">
            <li>Shorthand notation for setting
              all the three previous properties.
              (list-style-position: inside)</li>
          </ul>
        </li>
      </ol>
    </div>
  </body>
</html>

Javascript access:

// To SET values ([o] is the target object)
[o].style.listStyleType="list-style-type value"
// To GET values you must first get the computed style object
// To get that object in IE or Opera:
var cStyle=[o].currentStyle;
// To get that object in Firefox, Chrome or Safari (w3c-type):
var cStyle=window.getComputedStyle([o],null)
// To GET the property value:;
var value=cStyle.listStyleType;
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.