HTML Lists are used to specify lists of information. All lists may contain one or more list elements. There are three different types of HTML lists:
- Ordered List or Numbered List (ol)
- Unordered List or Bulleted List (ul)
- Description List or Definition List (dl)
In the ordered HTML lists, all the list items are marked with numbers by default. It is known as numbered list also. The ordered list starts with <ol> tag and the list items start with <li> tag.
Example
<!DOCTYPE><html>
<title>HTML Tutorials</title>
<body>
<ol>
<li>Computer Fundamental</li>
<li>C Programming</li>
<li>C++ Programming</li>
<li>Python Programming</li>
</ol>
</body>
</html>
Output
In HTML Unordered list, all the list items are marked with bullets. It is also known as bulleted list also. The Unordered list starts with <ul> tag and list items start with the <li> tag.
Example
<!DOCTYPE>
<html>
<title>HTML Tutorials</title>
<body>
<ul>
<li>Computer Fundamental</li>
<li>C Programming</li>
<li>C++ Programming</li>
<li>Python Programming</li>
</ul>
</body>
</html>
Output
HTML Description list is also a list style which is supported by HTML and XHTML. It is also known as definition list where entries are listed like a dictionary or encyclopedia.
The definition list is very appropriate when you want to present glossary, list of terms or other name-value list.
The HTML definition list contains following three tags:
- <dl> tag defines the start of the list.
- <dt> tag defines a term.
- <dd> tag defines the term definition (description).
<!DOCTYPE>
<html>
<title>HTML Tutorials</title>
<body>
<dl>
<dt>Computer Fundamental</dt>
<dd>-A computer is an electronic device that accepts data from the user, processes it, produces results, displays them to the users, and stores the results for future usage.</dd>
<dt>C Programming</dt>
<dd>-C is a computer programming language used to design computer software and applications.</dd>
<dt>C++ Programming</dt>
<dd>-C++ is a general purpose, case-sensitive, free-form programming language that supports object-oriented, procedural and generic programming.</dd>
<dt>Python Programming</dt>
<dd>-Python is the world's most popular and fastest-growing computer programming language. It is a multi-purpose and high-level programming language.</dd>
</dl>
</body>
</html>
Output
A list within another list is termed as nested list. If you want a bullet list inside a numbered list then such type of list will called as nested list.
Example
<!DOCTYPE>
<html>
<title>HTML Tutorials</title>
<body>
<p>List of Folk Dances of Different States in India</p>
<ol>
<li>Andhra Pradesh
<ul>
<li>Kuchipudi</li>
<li>Andhra Natyam</li>
<li>Butta Bommalu</li>
</ul>
</li>
<li>Assam
<ul>
<li>Bihu</li>
<li>Chingli</li>
<li>Naga Dance</li>
</ul>
</li>
<li>Gujarat
<ul>
<li>Garba</li>
<li>Dandiya Ras</li>
</ul>
</li>
<li>Kerala
<ul>
<li>Kathakali</li>
<li>Kaikottikali</li>
<li>Mohiniattam</li>
</ul>
</li>
<li>Maharashtra
<ul>
<li>Lavani</li>
<li>Nakata</li>
</ul>
</li>
<li>Punjab
<ul>
<li>Bhangra</li>
<li>Naqual</li>
<li>Dhaman</li>
</ul>
</li>
<li>Rajasthan
<ul>
<li>Ghumar</li>
<li>Jhulan Leela</li>
<li>Ganagor</li>
</ul>
</li>
</ol>
</body>
</html>
Output
No comments:
Post a Comment