...

View Full Version : How to change the attributes of a HR with CSS?



ze0nyx
02-08-2005, 06:51 PM
I have the following sheet:

HR
{
color:white;
width:100%;
height:1px;
}
And the HR-s look again gray and huge. How to fix this?

bazz
02-08-2005, 07:10 PM
is the HR assigned in your htmlk as <hr class="hr"> or have you written it some other way?

If it were me I would do the html like this <hr class="hr"> and then in the css put

.hr {
color : #fff;
width : 100%;
height : 1px;
}

Bazz

mcdougals4all
02-08-2005, 07:10 PM
There's been another thread on this over the last day or so...

http://www.codingforums.com/showthread.php?t=51764

This is a great place for answers. But many questions have been answered before. Don't forget to start with a forum search.

ze0nyx
02-08-2005, 09:00 PM
Thank you, I did it another way. But it worked with background-color instead of color.

bazz
02-09-2005, 12:42 PM
There's been another thread on this over the last day or so...

Ooops I should have remembered that, seeing as how it was my thread :o

Bazz

kickshuff
01-15-2009, 09:14 PM
Thank you, I did it another way. But it worked with background-color instead of color.
Thank-you, I would have never known the attribute "horizontal rule" was considered a background in CSS. I wish they would have put that in the CSS and (X)HTML books.

VIPStephan
01-15-2009, 11:47 PM
Thank-you, I would have never known the attribute "horizontal rule" was considered a background in CSS. I wish they would have put that in the CSS and (X)HTML books.

It isnít. A horizontal rule is an element (not an attribute) as any other element in HTML. Only there are different ways itís rendered in different browsers. If you want to change the color of a horizontal rule, you have to set both, the color and background color CSS properties. Internet Explorer ignores the background color but applies the color instead while the other major browsers apply the background color and ignore the color property.

Excavator
01-16-2009, 01:20 AM
hr can take the color from border settings too. Have a look at this: http://nopeople.com/CSS/hr/index.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum