Skip to content
Related Articles

Related Articles

Improve Article

HTML | <hr> width Attribute

  • Last Updated : 28 May, 2019

The HTML <hr> width attribute is used to specify the width of the horizontal line in terms of pixels or percent.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<hr width="pixels|%">

Attribute Values:

  • pixels: It sets the width of <hr> attribute in terms of pixels.
  • %: It sets the width of <hr> attribute in terms of percentage (%).

Note: The <hr> width attribute is not supported by HTML 5.


<!DOCTYPE html>
        HTML hr width Attribute
<body style="text-align:center;">
    <hr width="500px;">
    <p>Computer science portal</p>
    <hr width="70%">


Supported Browsers: The browser supported by HTML <hr> width attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :