From the course: HTML Essential Training

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Ordered, unordered, and description lists

Ordered, unordered, and description lists

From the course: HTML Essential Training

Ordered, unordered, and description lists

- Something we use in our everyday lives are lists, like shopping lists or to-do lists. So, it's not surprising that we'll also need to use lists in HTML to organize our content. There are three types, ordered, unordered, and description. Ordered lists are for items that follow a specific sequence, like directions or recipe steps. Unordered lists are for items that do not need to follow a specific order. And description lists are used to organize related terms and their descriptions. Let's take a look at the syntax. All list items are written as li tags, for ordered lists, the items are grouped using ol tags, and for unordered lists, use the ul tag. Only li tags can be nested inside both types of lists. If you want to include introductory texts, use a paragraph element outside of the ol or ul tag. Let's take a look at a CodePen example. In the first block of text, the content contains directions which need to be in a specific sequence, so an ordered list is used. When using the ol…

Contents