10.07.2017 Views

246996016-HTML5-Step-by-Step

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

54 Chapter 4<br />

Creating Definition Lists<br />

A definition list is just what it sounds like: a list that presents terms with their definitions,<br />

such as you would see in a glossary. The word being defined serves as a heading, and the<br />

definition paragraph is indented under it.<br />

The complete list (headings and definition paragraphs) is contained within the and<br />

tags, which stands for definition list. Each word to be defined is contained in a<br />

(definition term) tag, and the definition paragraphs are in (definition description)<br />

tags. Here’s the code for the example just shown:<br />

<br />

Fungus<br />

A primitive, non-vascular, non-photosynthetic form of plant life. Examples<br />

include mildews, molds, and mushrooms.<br />

Nematode<br />

A microscopic roundworm that lives in the soil. There are both harmful and<br />

beneficial nematodes. Harmful ones take their toll on the roots of the plant.<br />

<br />

<br />

This example shows a one-to-one relationship between words and definitions (one<br />

definition for each word), but that’s not a requirement. You can have multiple consecutive<br />

entries of either type. You might do this to accommodate situations in which a single<br />

word has two meanings or two words have the same definition.<br />

Note HTML permits you to omit the closing and tags, but you should get into the<br />

habit of using them anyway. XHTML requires them.<br />

In this exercise, you will create a glossary of terms on a Web page.<br />

SET UP Use the glossary.htm file in the practice file folder for this topic. This practice<br />

file is located in the Documents\Microsoft Press\<strong>HTML5</strong> SBS\04Lists\CreatingGlossary<br />

folder. Open the glossary file in Notepad and in Internet Explorer.<br />

1. In the area, enter the following:<br />

Gardening Terms<br />

Here are some useful gardening terms:

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

Saved successfully!

Ooh no, something went wrong!