Saturday, October 19, 2013

Filled Under:

How to create ordered list,unordered list and description list

Hey everyone..
The topic for today is HTML List.A list in HTML has the same meaning as any list of items etc.
The 2 most common types of lists in HTML
1. Ordered
2. Unordered

To start an ordered list we use the tag <ol> and then <li> tag to write the name of each item of the list.
To start an unordered list we use the tag <ul> and then <li> tag to write the name of each item of the list.
To start description lists list we use the tag <dl> .Description list is a list of names, with a description of each name.
By using the following tags you can make a list of anything you want.The procedure is very simple you just have to open the <ol> or <ul> tags and inside them define the <li> tag which stands for link and give the name of the item you want to display in the list.
Code of ordered list

<html>
<body>

<h4>List of cars</h4>
<ol>
  <li>Toyota Corolla</li>
  <li>Ferrari</li>
  <li>Volvo</li>
</ol>

</body>
</html>



Code of unordered list

<html>
<body>

<h4>An Unordered List:</h4>
<ul>
  <li>Toyota Corolla</li>
  <li>Ferrari</li>
  <li>Volvo</li></ul>

</body>
</html>


Code of description list

<html>
<body>

<h4>List of cars</h4>
<dl>
<dt>Ferrari</dt>
<dd>-Color red</dd>
<dt>Toyota Corolla</dt>
<dd>- Color White</dd>
</dl>

</body>
</html>






0 comments:

Post a Comment