Why background color not applied in hr tag? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why background color not applied in hr tag?

https://code.sololearn.com/WwSmGzz2Sk5C/?ref=app

4th Jun 2020, 12:56 PM
Ram Ji
5 Answers
+ 1
hr { background-color:red; height:2px; border:none; }
6th Jun 2020, 6:38 AM
SAN
SAN - avatar
+ 1
Please try
6th Jun 2020, 6:38 AM
SAN
SAN - avatar
0
Set the height of the hr tag then you can apply the background colour. Check code. https://code.sololearn.com/WLbNv2taSLj9/?ref=app
4th Jun 2020, 1:03 PM
Maninder $ingh
Maninder $ingh - avatar
0
Thanks
4th Jun 2020, 1:07 PM
Ram Ji
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;}
4th Jun 2020, 1:08 PM
Thống Nguyễn
Thống Nguyễn - avatar