ONLY WEBSAFE COLOURS FOR STYLING A <HR>?

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 1610  View(s)
Ratings:
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:

hr{
color: #ac8900;
background-color: #ac8900;
border-color: #ac8900;
height:2px;
border:none;
}
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. AVADHESH PATEL

    Post:604

    Points:4228
    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.

    hr{
    background-color: #ac8900;
    height:2px;
    }

    I hope it helpful to you

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!