Lists in HTML:
Lists in HTML:
In order to group the set of related items then in that case we use lists.
There are various types of lists available in HTML.
- Ordered lists
- Unordered lists
1. Ordered lists
These are the lists which initialized with <ol> tag and start with <li> tag inside <ol> tag.
By default, it is numeric for every point.
Example:
<!DOCTYPE html>
<html>
<body>
<p>Ordered list in html</p>
<ol>
<li>Rice</li>
<li>wheat</li>
<li>barley</li>
</ol>
</body>
</html>
2. Unordered lists
These are the lists which initialized with <ul> tag and start with <li> tag inside <ol> tag.
By default, it is marked with bullets when the content is fixed inside it.
Example:
<!DOCTYPE html>
<html>
<body>
<p>Unordered list in html</p>
<ul>
<li>Banana</li>
<li>Apple</li>
<li>Mango</li>
</ul>
</body>
</html>
Description lists in HTML:
There is also a new feature called Description lists.
Here this list defines the terms in form of Content followed by sub-content.
– <dl> = This define the description list
– <dt> = This basically define the term
– <dd> = This tag describes the every term.
Example:
<!DOCTYPE html>
<html>
<body>
<p>Discription list in html</p>
<dl>
<dt>Apple</dt>
<dd>- Eat apples in the morning</dd>
<dt>Banana</dt>
<dd>- Eat banana at night</dd>
</dl>
</body>
</html>
