How to make <hr> line a different color? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

How to make <hr> line a different color?

I need some help to figure out how to turn the <hr> line black. Iā€™ve tried <hr style=ā€œcolor:black;ā€> and that didnā€™t work. Iā€™ve also tried using CSS code ā€œhr{color: black;}ā€ and that didnā€™t work either.

25th Sep 2022, 12:59 AM
Lucas Pitirri
Lucas Pitirri - avatar
3 Respostas
+ 2
Use "border" attribute to style hr elements. I have no idea why. See here: https://www.w3schools.com/howto/howto_css_style_hr.asp
25th Sep 2022, 1:23 AM
Emerson Prado
Emerson Prado - avatar
+ 3
hr{ color: red; }
27th Sep 2022, 5:00 PM
Alex
Alex - avatar
+ 1
Thank you so much! Its kind of weird you cant use color: black; Thank you again!
25th Sep 2022, 12:09 PM
Lucas Pitirri
Lucas Pitirri - avatar