list
In this module we will do the following:
Explain the two types of lists and why we would want different ones.
Create an unordered list
<ul></ul>
Create an ordered list
<ol></ol>
File Location
For this module, you should be working in the following location:
Set Up
We'll be adding the code to the 03-lists
file.
List tags
There are only a few tags you'll need to be comfortable with when creating lists.
The two different tags that describe the type of list you're creating:
ul
: Unordered list, will create a bulleted list by default.
ol
: Ordered list, will create a numerical list by default.
And the tag that indicates that you're creating an item that belongs to a list (a list item):
li
- Used in both types of lists.
Ordered Lists
Go ahead and create an ordered list. Please add the following to the ordered list to the file:
Unordered List
And here is an example of an unordered list. You can simply write this beneath the closing (</ol>) tag of the list from the above example.
Don't forget to alt + b
after adding your code and saving your file to view the result of your work.
List Uses
Lists are all over the place in Web Development, whether it's a nav bar for site navigation, a list of photos, a list of contacts, etc. You'll see lists all over the place. When we get to CSS, we'll see how we can style our lists in different ways.
Let's move on to Links.
Last updated