04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

constructing a list<br />

Constructing <strong>HTML</strong> lists in two easy steps<br />

Creating an <strong>HTML</strong> list requires two elements that, when used together,<br />

form the list. The first element is used to mark up each list item. The<br />

second determines what kind of list you’re creating: ordered or unordered.<br />

Let’s step through creating Tony’s list of cities in <strong>HTML</strong>.<br />

Step One:<br />

Put each list item in an element.<br />

To create a list, you put each list item in its own element,<br />

which means enclosing the content in an opening tag and<br />

a closing tag. As <strong>with</strong> any other <strong>HTML</strong> element, the<br />

content between the tags can be as short or as long as you like<br />

and broken over multiple lines.<br />

We’re just showing a fragment of the <strong>HTML</strong><br />

from Tony’s journal here.<br />

104 Chapter 3<br />

August 20, 2005<br />

<br />

<br />

Well I’ve made it 1200 miles already, and I passed<br />

through some interesting places on the way:<br />

<br />

Walla Walla, WA<br />

Magic City, ID<br />

Bountiful, UT<br />

Last Chance, CO<br />

Why, AZ<br />

Truth or Consequences, NM<br />

July 14, 2005<br />

Locate this <strong>HTML</strong> in your “journal.html” file and keep<br />

up <strong>with</strong> the changes as we make them.<br />

<strong>First</strong> move the list items outside of the paragraph. The list<br />

is going to stand on its own.<br />

<br />

I saw some Burma Shave style signs on the side of<br />

the road today:<br />

<br />

...and then enclose each list item<br />

<strong>with</strong> an , set of tags.<br />

Each of these <br />

elements will become an<br />

item in the list.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!