<li>
BrandonDusch580 total contributions
Published Jul 1, 2022
Contribute to Docs
The <li>
element represents a single list item. This element must be wrapped in an <ol>
, <ul>
, or <menu>
element.
Syntax
<li>Text for list item</li>
Content is required to be between the opening and closing <li>
tags. It can hold any valid HTML, and each <li>
element will be indented and preceded either with a number (for ordered lists), or a dot (for unordered lists and menus).
Example
<!DOCTYPE html><html><head> </head><body><h3>My Favorite Things</h3><ul><li>Rain drops on roses</li><li>Whiskers on kittens</li><li>Bright copper kettles</li><li>Warm woolen mittens</li></ul><h3>To-do List</h3><ol><li>Make bed</li><li>Brush teeth</li><li>Have breakfast</li><li>Continue learning HTML</li></ol></body></html>
This will output the following;
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.