The HTML <hr> width attribute is used to specify the width of the horizontal line in terms of pixels or percent.
Syntax:
html
Output:
Supported Browsers: The browser supported by HTML <hr> width attribute are listed below:
<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 (%).
<!DOCTYPE html>
<html>
<head>
<title>
HTML hr width Attribute
</title>
</head>
<body style="text-align:center;">
<h1>GeeksforGeeks</h1>
<hr width="500px;">
<p>Computer science portal</p>
<hr width="70%">
</body>
</html>
Supported Browsers: The browser supported by HTML <hr> width attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera