Table of Contents

Web Development Lesson 3 - Lists

Simple Lists

Objectives

In this exercise you will create a bulleted list and a numbered list and learn some list-specific formatting rules.

Setup

<h2>Pancake Recipe</h2>
<h3>Ingredients</h3>
<h3>Method</h3>

Numbered List

<h3>Method</h3>
<ol>
  <li>Mix ingredients</li>
  <li>Pour mix into pan</li>
  <li>Cook 1 minute on each side</li>
  <li>Serve</li>
</ol>
<h3>Method</h3>
<ol>
  <li>Mix ingredients</li>
  <li>Heat pan</li>
  <li>Pour mix into pan</li>
  <li>Cook 1 minute on each side</li>
  <li>Serve</li>
</ol>

Bullet List

<h3>
  Ingredients
</h3>
<ul>
  <li>100g flour</li>
  <li>2 eggs</li>
  <li>300ml milk</li>
</ul>

CSS

<ul style="list-style-position: inside;">
<li style="border: solid red 1px;">
li {
  border: solid red 1px;
}

CSS Priority

<li style="border: solid blue 3px;">

CSS for Lists

ul {
  list-style-type: square;
}
ol {
  list-style-type: upper-roman;
}

Final Code

If you get to this point and something isn't quite right, or you'd like to check your code, here is the code we've been working on.

Next: Multi-level Lists