📖 Creating HTML Lists
There are 3 types of lists that can be created with HTML elements: an unordered or bulleted list, an ordered (numbered) list, or a description list which places the term on the left margin and indents the description.
<ol> |
Indicates the beginning of an ordered (numbered or lettered) list. |
<ul> |
Indicates the beginning of an unordered (bulleted) list. |
<li> |
Indicates a new list item. |
<dl> |
Indicates the beginning of a description list. |
<dt> |
Indicates a new description list term |
<dd> |
Indicates a new description list description and indents the text. |
- Everything within an
<ol>
or<ul>
tag must be contained within an<li>
element. - The
<li>
element may contain anything - text, images, other html tags, nested lists, etc. - To start numbering (or lettering) a list with something other than the default, add the
value="x"
attribute to the<ol>
tag where x is the starting value of the list. - Everything within a
<dl>
element must be contained within a<dt>
or<dd>
element - Nested lists are automatically indented from the parent element
Sample Lists
Additional List styles
list-style-type: changes the default style of the bullet for unordered lists