This website may use cookies. More info. That's Fine x
Welcome Login

ul and ol tags


ul tag:

ul tag defines an unordered (bulleted) list.

Use ul tag together with the li tag to create unordered lists.

ul attributes:

Attribute        Value           Description

type             disc            Specifies the kind of marker to use in the list
                 square
                 circle 	     

 

Eg:

<!DOCTYPE html>
<html>
<body>

<h4>An Unordered List:</h4>
<ul>
  <li>Sony PS3</li>
  <li>Nintendo Wii</li>
  <li>Microsoft XBox</li>
</ul>

</body>
</html>

 

Outputs:

html-ul1

 

 

ol tag:

ol tag defines an ordered list. An ordered list can be numerical or alphabetical.

Use the li tag to define list items.

ul attributes:

Attribute        Value           Description

reversed         reversed        Specifies that the list order should be descending

start            number          Specifies the start value of an ordered list

type             1               Specifies the kind of marker to use in the list
                 A
                 a
                 I
                 i

 

Eg:

<!DOCTYPE html>
<html>
<body>

<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

<ol start="50">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
 
</body>
</html>

 

Outputs:

html-ul2


Created on: Monday, November 12, 2012 by Andrew Sin