Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (20.3k points)

I want to change the color of my hr tag using CSS. The code I've tried below doesn't seem to work:

hr {

    color: #123455;

}

1 Answer

0 votes
by (40.7k points)

Try using border-color instead of color, if you want to change the color of the line produced by <hr> tag.

Code:

hr { display: block; height: 1px;

    border: 0; border-top: 1px solid #ccc;

    margin: 1em 0; padding: 0; }

For more information, you can refer to https://github.com/paulirish/html5-boilerplate/blob/ef3c095bafa9a6fa9c771f368d4b30c8ce4deded/css/style.css#L75

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...