New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Why background color not applied in hr tag?
5 Answers
+ 1
hr {
background-color:red;
height:2px;
border:none;
}
+ 1
Please try
0
Set the height of the hr tag then you can apply the background colour.
Check code.
https://code.sololearn.com/WLbNv2taSLj9/?ref=app
0
Thanks
0
Ram Ji actually it's applied. What you see is just border of the hrs(height=0). Try set the hrs height and you will see. Or just set the css rule: hr{border-color:red;}