7 Lists

Lists are incredibly important in digital writing. They can help break up large sections of text and make them less intimidating for readers, they can improve document flow, and they can increase comprehension. There are two primary types of lists:

  • Unordered lists
  • Ordered lists

Unordered lists

Unordered lists don’t have to be completed in any particular order. Usually, these are simple bulleted lists. To code an unordered list, you must first wrap the entire section in <ul> tags, like this:

Image of coded unordered list tags
Fig. 18. Unordered list tags

The space between the tags will be used for your bullet points. Let’s make an unordered list with different kinds of pasta. First, we’ll fill in our pasta types:

Image of unordered list items without tags
Fig. 19. Unordered list without tags

Next, we have to tell the HTML code that each of these is an individual bullet point. Remember that HTML ignores white space, so if we rendered the page now, even though our steps are on different lines, it would all be one giant paragraph. The <ul> tags already tell the code that we have an unordered list, so now we just need to differentiate each bullet point. We do this with <li> tags:

Image of unordered list coded with tags
Fig. 20. Unordered list with tags

Now, we can load the page and we’ll see our unordered list:

Image of unordered list on live page
Fig. 21. Unordered list on live page

Ordered lists

Ordered lists are used for steps that need to be read or completed in a particular order. Usually, these lists are numbered. Ordered lists work exactly like unordered lists, except instead of the <ul> wrapper, you use <ol>. Take a look at the code below for an ordered list with the steps to cook pasta:

Image of code for ordered list
Fig. 22. Code for ordered list

This is how that looks on a webpage:

Image of ordered list on live page
Fig. 23. Ordered list on live page

Lists are a great tool, but sometimes your content will need more organization. Tables are a great way to help readers take in large amounts of information quickly.

License

HTML & CSS Basics for Digital Writers Copyright © by Cate Deventer. All Rights Reserved.

Share This Book