Home > DeveloperSection > Forums > Only websafe colours for styling a <hr>?
Ankit Singh

Total Post:341

Points:2389
Posted on    May-09-2013 5:36 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 1219  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:

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?


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    May-09-2013 8:10 AM

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

Don't want to miss updates? Please click the below button!

Follow MindStick