How to change the color of HR tag with CSS
In this tutorial, we are going to see how to change the color of HR tag with CSS. You can easily use the background-color attribute in combination with height and border properties to modify the default color of the <hr> tag.
Source Code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Change the color of HR tag with CSS</title> <style> hr{ height: 3px; background-color: #ff7d95; border: none; } </style> </head> <body> <h1>Title</h1> <hr> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> </body> </html>
Result |
---|
TitleLorem ipsum dolor sit amet, consectetur adipiscing elit. |