Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS change color of hr tag [duplicate]

Tags:

Possible Duplicate:
CSS : change color of hr tag

how do you change the color of an hr tag? i looked it up and found this, but it didnt work..

hr{
    color:#CCC;
    background-color:#CCC;
}

Any ideas?

like image 747
user1269625 Avatar asked Mar 19 '12 15:03

user1269625


People also ask

Can you change the color of HR in CSS?

The color of the <hr> tag can be set by using the background-color property in CSS.

How do you make HR a solid color?

Try setting it to white on white background. These two will work: Either 1) color:white; border-style:solid; or 2) border-color:white; border-style:solid; .

How do I change the color of HR in HTML without CSS?

tl;dr: You can't. Not only does hr not have a color attribute in XHTML, it never had a color attribute, in any version of HTML! Just use CSS already.


2 Answers

Style the border.

hr{
   border: 1px solid #ccc;
}
like image 193
Paul Sham Avatar answered Sep 21 '22 09:09

Paul Sham


Just change the border color. For instance, this HTML produces a red horizontal row.

<hr style="border: 1px solid #f00" />​
like image 32
dangerChihuahua007 Avatar answered Sep 19 '22 09:09

dangerChihuahua007