HTML Text Handling

Topic

How to draw a horizontal line in html?
How to use lists in html?

Explanation


Horizontal Line: <hr>
This is special tag used to draw new horizontal lines.
It doesn't require closing tags.

Example Code:

<hr>

Result:



This tag has the attribute "width" to specify the width of the line
<hr width=60%> will give the below line

Example Code:

<hr width=60%>



Lists :


Un Ordered Lists: <ul> , <li>
Tag to create a list of items.

Example Code


<ul>
<li>List1</li>
<li>List2</li>
</ul>

Result:

  • List1
  • List2

Ordered Lists: <ol> , <li>
Tag to create a list of numbered items. The numbering will be done automatically.

Example Code


<ol>
<li>List1</li>
<li>List2</li>
</ol>

Result:

  1. List1
  2. List2

Nested Lists: <ul> , <li>

Example Code


<ul>
<li>List1</li>
<ul>
<li>Sub List1</li>
<li>Sub List2</li>
</ul>
<li>List2</li>
</ul>

Result:

  • List1
    • Sub List1
    • Sub List2
  • List2