Only websafe colours for styling a <hr>?

Posted by  Ankit Singh
 2069  View(s)
Rate this:
Hi Expert!

I have a <hr> and I need it to have the color (hex value) #ac8900. If I style it the old fashioned way

<hr color="#ac8900">
it works fine. But I'm expected to style everything with CSS, so I tried this in my style sheet:

color: #ac8900;
background-color: #ac8900;
border-color: #ac8900;
But it doesn't work. Other, more 'basic' color work such as #000, #fff etc but not the one I need. Can you only colors a <hr> with css using web safe colors?
  1. Re: Only websafe colours for styling a <hr>?

    Hi Ankit!

    Your property values are invalid. you need RGB codes for the values to be valid. Try the below style.

    No need of border-color if border:none, Similarly color doesn't make sense here too.

    background-color: #ac8900;

    I hope it helpful to you