Reputation: 14243
I tried all ways to change color of <hr/>
:
hr{
border-color: yellow;
background-color: yellow;
color: yellow;
}
but it appears like this in both Chrome and FF:
How can I change its color to pure yellow?
Upvotes: 4
Views: 25377
Reputation: 17
To change the color of your horizontal rule, in your <hr/>
tag, type the html attribute color=""
. Then you can go ahead giving it the desired color.
Upvotes: 0
Reputation: 15609
Give hr
a style with:
hr{
border:0;
margin:0;
width:100%;
height:2px;
background:yellow;
}
or
border:1px solid yellow;
You need to get rid of the border
or change the border
's properties for it work.
From @Darko Z in the comments:
In many browsers the default style for
HR
is to add some sort of shading to theborder
so this comes out as dirty #whateverColourYouWant. To get rid of it, setting border explicitly (and not justborder-color
) is necessary.
Upvotes: 11