HTML Lists

It is time to create order out of the chaos. Let's make a list of what we have learned so far.

HTML gives us three types of lists to choose from. Unordered lists are marked with bullets, ordered lists are marked with numbers, letters, or roman numerals, and definition lists include a description of each item or term.

Unordered Lists

Unordered, or bulleted lists begin with <ul> and end with </ul>. They have a series of <li> and </li> tags in between to identify each item on the list.

<ul>
  <li>What is HTML?</li>
  <li>How to Create An HTML File</li>
  <li>HTML Document Structure</li>
</ul>

The result of this list is:

  • What is HTML?
  • How to Create An HTML File
  • HTML Document Structure

Bulleted lists have three bullet types available. The options are circle, square or disc. The default is disc.

<ul>
  <li type="circle">What is HTML?</li>
  <li type="square">How to Create An HTML File</li>
  <li type="disc">Basic HTML Tags/Elements</li>
</ul>

The result of this list is:

  • What is HTML?
  • How to Create An HTML File
  • Basic HTML Tags/Elements

Ordered Lists

Ordered, or numbered lists begin with <ol> and end with </ol>. They have a series of <li> and </li> tags in between to identify each item on the list.

<ol>
  <li>HTML Meta, Link & Script Tags</li>
  <li>HTML Doctypes & Validation</li>
  <li>HTML Comments</li>
</ol>

The result of this list is:

  1. HTML Meta, Link & Script Tags
  2. HTML Doctypes & Validation
  3. HTML Comments

Numbered lists have five options, or types available. The options are numbers, lower-case roman numerals, upper-case roman numerals, lower-case letters or upper-case letters. The preferred type is indicated in the opening <ol> tag.

Numbers: <ol> </ol>
Lower-Case Letters: <ol type="a"> </ol>
Upper-Case Letters: <ol type="A"> </ol>
Lower-Case Roman Numerals: <ol type="i"> </ol>
Upper-Case Roman Numerals: <ol type="I"> </ol>

Definition Lists

Definition lists begin with <dl> and end with </dl>. They have a series of <dt> </dt> "definition term" and <dd> </dd> "definition description" tags in between to identify and define each item on the list.

<dl>
  <dt>HTML</dt>
  <dd>Hypertext Markup Language</dd>
  <dt>CSS</dt>
  <dd>Cascading Style Sheets</dd>
  <dt>PHP</dt>
  <dd>PHP: Hypertext Preprocessor</dd>
</dl>

The result of this list is:

HTML
Hypertext Markup Language
CSS
Cascading Style Sheet
PHP
PHP: Hypertext Preprocessor

I know I'm enjoying the lack of chaos. How about you?