Monday 25 September 2023

Lists in HTML

 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

  1. Apple
  2. Strawberry
  3. 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

Java Script Learning

 Introduction to JavaScript JavaScript is the programming language used by front-end web developers to instruct the browser to add behaviors...