Login:
Password:
 
 
 

Free HTML Tutorial - Learn HTML

 

Horizontal Lines / Dividers

Horizontal lines are great for breaking up paragraphs of text or separating sections of your page.

To create the standard/default horizontal line, you'll just simply insert the <hr> code.  This will create a line that looks like this:


Setting Horizontal Line Width,  Size and Color

To set the width of your line, simply add a "width" attribute.  For example, 
<hr width="250">
will create a line that is 250 pixels wide.  See below...


You can also set the size of the line by inserting a value.  So if you wanted a line that is 250 pixels wide and 6 pixels thick, you'd use the following code: 

<hr width="250" size="6">

This will produce the line below:


Lastly, you can control the color of the line by inserting the color attribute:

<hr width="250" size="6" color="blue">


You may also use hex colors to define the color of the line.