How to create lists in HTML..?
What is a List..?
HTML lists allow us to group a set of related items in lists.
Lists in a web application:
- Unorderd List
- Orderd List
- Description List
- Unorderd List
🔆 A list of related items not in a particular order...
Output:-
Vegetable List
- Carrot
- Leaks
- Pumpkin
HTML Code:-
<!DOCTYPE html>
<html>
<body>
<h2>Vegetable List</h2>
<ul>
<li>Carrot</li>
<li>Leaks</li>
<li>Pumpkin</li>
</ul>
</body>
</html>
- Orderd List
🔆 A list of related items, in a specific order...
Output:-
Fruits List
- Apple
- Strawberry
- Grapes
HTML Code:-
<!DOCTYPE html>
<html>
<body>
<h2>Fruits List</h2>
<ol>
<li>Apple</li>
<li>Strawberry</li>
<li>Grapes</li>
</ol>
</body>
</html>
- Description List
🔆 A list of items and their descriptions...
Output:-
Students
Eranga :
She did her A/L's in Engineering Technology Stream
Minuri :
She did her A/L's in Art Stream
Rashodha :
She did her A/L's in Art Stream
HTML Code:-
<!DOCTYPE html>
<html>
<body>
<h2>Students</h2>
<dl>
<dt>Eranga :</dt>
<dd>She did her A/L's in Engineering Technology Stream</dd>
</dl>
<dl>
<dt>Minuri :</dt>
<dd>She did her A/L's in Art Stream</dd>
</dl>
<dl>
<dt>Rashodha :</dt>
<dd>She did her A/L's in Art Stream</dd>
</dl>
</body>
</html>
Written by: W.A. Eranga Dewmini
No comments:
Post a Comment