ol tag
ul tag
dd tag
dl tag
dt tag
TAG: li
<li> ... </li>
The
li
tag is used to list an item in a list. This tag is required for both the ordered list
ol
tag and the unordered list
ul
tag.
For ordered and unordered lists, there are essentially no restrictions as to the text that may be placed in a list, such as length.
In an unordered list, each item is preceded by a bullet, such as . In an ordered list, each item is labeled with a number, letter, or Roman numeral that increments with each following item.
The separate closing tag is mandatory.
Attributes and Events
class
dir
id
lang
onclick
ondblclick
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
style
title
This is an unordered list.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML li Tag Example</title>
</head>
<body>
Three Major Types Of Lists:
<ul>
<
li
> Definition List<
/li
>
<ul style="list-style-type: square;">
<
li
> dd tag<
/li
>
<
li
> dl tag<
/li
>
<
li
> dt tag<
/li
>
</ul>
<
li
> Ordered List</li>
<ul style="list-style-type: circle;">
<
li
> ol tag<
/li
>
<
li
> li tag<
/li
>
</ul>
<
li
> Unordered List
<ul style="list-style-type: disc;">
<
li
> ul tag<
/li
>
<
li
> li tag<
/li
>
</ul>
</ul>
</body>
</html>
Output:
Three Major Types Of Lists:
Definition List
dd tag
dl tag
dt tag
Ordered List
ol tag
li tag
Unordered List
ul tag
li tag
This is an ordered list.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML li Tag Example</title>
</head>
<body>
Three Major Types Of Lists:
<ol>
<li> Definition List</li>
<ol style="list-style-type: lower-alpha;">
<li> dd tag</li>
<li> dl tag</li>
<li> dt tag</li>
</ol>
<li> Ordered List</li>
<ol >
<li> ol tag</li>
<li> li tag</li>
</ol>
<li> Unordered List
<ol style="list-style-type: upper-roman;">
<li> ul tag</li>
<li> li tag</li>
</ol>
</ol>
</body>
</html>
Output:
Three Major Types Of Lists:
Definition List
dd tag
dl tag
dt tag
Ordered List
ol tag
li tag
Unordered List
ul tag
li tag
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information