Lists
Lists are used to group items in a list of items.
Agenda
- HTML Lists
- Unordered Lists
- Ordered Lists
- CSS Lists Properties
start
attribute- Description Lists
Lists
There are 2 kinds of lists in HTML: unordered or bulleted lists and ordered or numbered lists.
An unordered list contains a list of items that don’t need to be in a particular order.
The <ul>
and </ul>
tags are used to create unordered or bulleted lists.
Items in the lists are added by using the <li>
and </li>
tags.
<!DOCTYPE html>
<html>
<head>
<title>HTML Lists</title>
</head>
<body>
<h1>Most Popular Web Browsers</h1>
<ul>
<li>Mozilla Firefox</li>
<li>Google Chrome</li>
<li>Opera Browser</li>
<li>Microsoft Edge</li>
<li>Safari Browser</li>
</ul>
</body>
</html>
An ordered list is useful for presenting a series of steps that the user should perform in order.
The <ol>
and </ol>
tags are used to create ordered lists or numbered lists.
<!DOCTYPE html>
<html>
<head>
<title>HTML Lists</title>
</head>
<body>
<h1>Phases of Web Development Life Cycle</h1>
<ol>
<li>Planning</li>
<li>Analysis</li>
<li>Design</li>
<li>Development</li>
<li>Testing</li>
<li>Implementation</li>
<li>Maintenance</li>
</ol>
</body>
</html>
CSS Lists Properties
list-style-type
The list-style-type property is used to define the style of the list item marker.
list-style-image
The list-style-image property used to specify an image as the list item marker in unordered lists.
list-style-position
The list-style-position property specifies the position of the list item marker in unordered lists.
list-style
The list-style property is a shorthand property. It is use to set all the list properties in one declaration.
Last updated on