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

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...