Advertisements
Advertisements
Question
Write the difference between <ol> and <ul> tags in HTML. Also, write suitable examples of each to illustrate the difference.
Answer in Brief
Advertisements
Solution
<ol> Tag:
- The <ol> tag denotes an ordered list. Each list item is preceded by the <li> tag.
- By default, the list items will be labelled with numbers.
Example:
<ol>
<li>Coffee</li>
<Ii>Tea</Ii>
<li>Milk</li> </ol>
Output:
CoffeeTeaMilk
<ul> Tag:
- The <ul> tag denotes an unordered list. Each list item begins with the tag <li>.
- The list items will be highlighted with bullets (little black circles) by default.
Example:
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Output:
CoffeeTeaMilk
shaalaa.com
Is there an error in this question or solution?
