HTML - Horizontal Line

Horizontal line:

  • A horizontal line in HTML is defined by using the tag <hr>. Here hr stands for a horizontal rule.
  • <hr> tag is used to insert a thematic break in an HTML page or to separate the contents on the page.
  • <hr> tag is an empty tag that doesn't have a closing/end tag.
  • It comprises of the below attributes

Attribute  Description
Size Defines the height of the horizontal line
Width Defines the line width
Align Aligns line to left, center, right
No Shade Removes the Shallow shape
Color Sets a color for line

<!DOCTYPE html>
<html>
    <head>
        <title>HTML Horizontal line/rule Example</title>
    </head>
    <body>
        <div>                    
            <p> paragraph1 </p>
            <!-- adding break using hr tag -->
            <hr size="10" width="300" color="green" noshade align="left">
            <p> paragraph2</p>
        </div>
    </body>
</html>
Output:
HTML - Horizontal Line

No comments:

Post a Comment