English

Write the difference between <ol> and <ul> tags in HTML. Also, write suitable examples of each to illustrate the difference. - Computer Applications

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:

  • Coffee
  • Tea
  • Milk

<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:

  • Coffee
  • Tea
  • Milk
shaalaa.com
  Is there an error in this question or solution?
2022-2023 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×