0% found this document useful (0 votes)
24 views

2.HTML Lists

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

2.HTML Lists

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML Lists

HTML lists allow web developers to group a set of related items in lists.

types of Lists:
1. Ordered List
2. Unordered List
3. Definition or Description List(html5)

Ordered Lists ( <ol> ):Ordered lists are used when you want to present a list of
items in a specific order, typically using numbers or letters as markers. To create an
ordered list, use the <ol> element and list items with the <li> (list item) element.
Example:
<ol>
<li>Java</li>
<li>Selenium</li>
<li>html</li>
<li>Css</li>
</ol>

This will render as:


1. Java
2. Selenium
3. html
4. Css

Unordered Lists ( <ul> ): Unordered lists are used when the order of items doesn't
matter. They typically use bullets or other symbols as markers. To create an unordered
list, use the <ul> element and list items with the <li> element.
Example:
<ul>
<li>Java</li>
<li>Selenium</li>
<li>html</li>
<li>css</li>
</ul>

This will render as:


Java
Selenium
html
css
Definition Lists ( <dl> ): Definition lists are used for glossaries or lists of terms and
their corresponding definitions. They consist of a term (defined using <dt> ) and its
definition (defined using <dd> ).
Example:
<dl>
<dt>term 1</dt>
<dd>Definition 1</dd>
<dt>term 2</dt>
<dd>Definition 2</dd>
<dt>term 3</dt>
<dd>Definition 3</dd>
</dl>

This will render as:


term 1
Definition 1
term 2
Definition 2
term 3
Definition 3
Definition lists provide a way to present information where each item is a pair of a term
and its associated definition.
Lists can be nested within one another to create more complex structures. For example,
you can have ordered or unordered lists inside list items of another list. This nesting
allows you to create multi-level lists for better organization of content.
Example:
<ol>
<li>Manual Testing</li>
<li>Automation Testing
<ul>
<li>java</li>
<li>Selenium</li>
<li>TestNg</li>
</ul>
</li>
<li>Mobile Testing</li>
</ol>

This will render as:


1. Manual Testing
2. Automation Testing
java
Selenium
TestNg
3. Mobile Testing
HTML lists are a fundamental part of structuring web content, making it easier for users
to consume information and understand the hierarchy of the content presented on a
web page.

You might also like