7
Lists in XHTML

Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Embed Size (px)

Citation preview

Page 1: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Lists in XHTML

Page 2: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Two main types of lists

Ordered Lists• sequences (e.g. the steps

in a recipe) or preferences• carry numbers (Arabic or

Latin) or letters

Example:1. first step2. second step3. third step

Unordered Lists• items that do not have a

natural order (e.g. the ingredients in a recipe)

• carry bullet points, symbols or dashes

Example:– first item– second item– third item

Page 3: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

XHTML Markup

Source Code:

<ol><li>first item</li><li>second item</li><li>third item</li>

</ol>

Result in the browser:

1. first item2. second item3. third item

Page 4: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Advantages

• numbering is done automatically:

My favourite books:1. Alice in Wonderland2. Peter Pan3. Lord of the Rings Harry Potter

Page 5: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Advantages

Source Code:<ol>

<li>Alice in Wonderland</li><li>Harry Potter</li><li>Peter Pan</li><li>Lord of the Rings</li>

</ol>

Page 6: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

The new list:

My favourite books:1. Alice in Wonderland2. Harry Potter3. Peter Pan4. Lord of the Rings

Page 7: Lists in XHTML. Two main types of lists Ordered Lists sequences (e.g. the steps in a recipe) or preferences carry numbers (Arabic or Latin) or letters

Nested Lists

Writing a term paper:1. Finding a topic2. Collecting literature

– from the library– from the internet

3. Writing the text

Source code:<ol>

<li>Finding a topic</li><li>Collecting literature <ul> <li>from the library</li> <li>from the internet</li> </ul></li><li>Writing the text</li>

</ol>