Files
freeCodeCamp/mock-guide/english/html/elements/lists/index.md
Stuart Taylor 7da04a348b fix: Update packages and fix local dev (#26907)
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. -->

- [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md).
- [x] My pull request has a descriptive title (not a vague title like `Update index.md`)
- [x] My pull request targets the `master` branch of freeCodeCamp.
2018-10-23 18:48:46 +05:30

1.8 KiB

title
title
Lists

Lists

There are three types of lists in HTML. All lists must contain one or more list elements.

Unordered HTML List

The unordered list starts with <ul> tag and list items start with the <li> tag. In unordered lists all the list items marked with bullets by default.

<ul>
  <li>Item</li>
  <li>Item</li>
  <li>Item</li>
</ul>

Output:

<html>
  • Item
  • Item
  • Item
</html>

Ordered HTML List

The ordered list starts with <ol> tag and list items start with the <li> tag. In ordered lists all the list items are marked with numbers.

<ol>
  <li>First Item</li>
  <li>Second Item</li>
  <li>Third Item</li>
</ol>

Output:

<html>
  1. First Item
  2. Second Item
  3. Third Item
</html>

HTML Description List

The description list contains list items with their definitons. We use <dl> tag to start list, <dt> tag to define a term and <dd> tag to describe each term.

<dl>
<dt>freeCodeCamp</dt>
<dd>Learn to code with free online courses, programming projects, and interview preparation for developer jobs.</dd>
<dt>GitHub</dt>
<dd>GitHub is a web-based Git or version control repository and Internet hosting service. It is mostly used for code.</dd>
</dl>

Output:

<html>
freeCodeCamp
Learn to code with free online courses, programming projects, and interview preparation for developer jobs.
GitHub
GitHub is a web-based Git or version control repository and Internet hosting service. It is mostly used for code.

More Information:

HTML

w3schools