More HTML Lists We often want to add a list to a document HT

More HTML

Lists

We often want to add a list to a document. HTML provides two kinds of lists,ordered(e.g., 1, 2, 3) and unordered (e.g., bulleted). A list is introduced with the <OL> or <UL> ta g, depending on whether it is ordered or unordered. Each list item is introduced with a <LI> tag and ended with the </LI> ta g. The entire list is then ended with </OL> or </UL>, as appropriate. For example, the code below creates the list shown; replacing the <OL> and </OL> tags with <UL> and </UL> would produce the same list withbullets instead of numbers.Things I like:

<OL>

<LI>chocolate <LI>rabbits <LI>chocolate rabbits

</OL>

Things I like:

1. chocolate

2. rabbits

3. chocolate rabbits

---------------------------------------------------------------

Exercise #2:

Add a list, either ordered or unordered, of at least three elements to your document.

---------------------------------------------------------------

Links

Links connect one document to another. Links are created in HTML with the<A> (anchor) tag. When creating a linkyou have to specify two things:

---------------------------------------------------------------

Exercise #3:

Add at least one link that ties in to the material on your page.

Solution

<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"utf-8\">   
</head>

<body>

<UL> <!--creates unordered list which is Exercise 2-->
<LI>red </LI>
<LI>yellow </LI>
<LI>blue </LI>
</UL>

<A href=\"link.html\">click to open linked document</A> <!--creates link to another document named link.html which is in the same directory as this file which is Exercise 3 -->
</body>

</html>

Save the below file as link.html in the same directory as the above file

<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"utf-8\">   
</head>

<body>

<UL>
<LI>red11 </LI>
<LI>yellow11 </LI>
<LI>blue11 </LI>
</UL>

</body>

</html>

More HTML Lists We often want to add a list to a document. HTML provides two kinds of lists,ordered(e.g., 1, 2, 3) and unordered (e.g., bulleted). A list is int
More HTML Lists We often want to add a list to a document. HTML provides two kinds of lists,ordered(e.g., 1, 2, 3) and unordered (e.g., bulleted). A list is int

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site