G
Gaffer
How do change the colour of a horizontal line? <hr>
Regards
_____
Gaffer
Regards
_____
Gaffer
<hr style="color: blue; background-color: blue;">Gaffer said:How do change the colour of a horizontal line? <hr>
Regards
_____
Gaffer
How do change the colour of a horizontal line? <hr>
Regards
_____
Gaffer
Gaffer wrote:>>
Simple answer.
<hr color="white">
color can be name as shown, "#fff" -hex 8 bit, ""#ffffff" -hex 16 bit, or
"rgb(255,255,255)".
Better:
<hr style="color:#fff">
There is no color attribute for the HR element.
First of all, HTML colors can only come in two forms: one of 16 select
color names ("white" is one of them) or a 24-bit hexadecimal number
(#FFFFFF is 24 bit, not 16 bit).
#FFF is only allowed with CSS, whether or not IE still supports it in
HTML attributes. Also, it is 12 bits, not 8. rgb() syntax is also not
valid in HTML attributes; it is only valid in CSS.
Note that a hexidecimal number needs 4 bits (or one nibble) of storage
space to be
stored -- 16 = 2^4. Thus, a number with 6 hexidecimal digits requires
24 bits, while one with 3 hexidecimal digits requires 12 bits.
And the CSS color property applies to the text color. IE uses the
color property in its demented way; it renders the HR as blue even
though HR elements have no text. Other browsers use the
background-color property.
Els's solution of <hr style="color: #fff; background-color: #fff;">
works better.
First of all, HTML colors can only come in two forms: one of 16 select
color names ("white" is one of them) or a 24-bit hexadecimal number
(#FFFFFF is 24 bit, not 16 bit).
#FFF is only allowed with CSS, whether or not IE still supports it in
HTML attributes. Also, it is 12 bits, not 8. rgb() syntax is also not
valid in HTML attributes; it is only valid in CSS.
Note that a hexidecimal number needs 4 bits (or one nibble) of storage
space to be
stored -- 16 = 2^4. Thus, a number with 6 hexidecimal digits requires 24
bits, while one with 3 hexidecimal digits requires 12 bits.
Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
<hr style="color:#fff">
There is no color attribute for the HR element.
Richard said:Then to tell that to this guy:
http://www.webdiner.com/annexe/hr/hr.htm
Richard said:
Richard said:Not quite. A single hexadecimal unit is 8 bit. Two units makes it 16
bits. 8 bit is defined by "#000" and 16 by "#010101".
It is supported in versions 4 and above. In IE, netscape and mozilla
as well as others.
In using rgb(00,00,00), the 3 sets of values automatically define it
as 24 bit.
In the hex format, it is still 24 bit but defined by 3 pairs of values
writtten without the comma.
So technically we should have "#FF,00,FF".
As you should know, 8 bits = 255 possible combinations.
16 bits therefor = 65,005 possible combinations.
<grin />
Yes. We should also tell him this:
I see no mention of a color attribute anywhere in the DTD entry for <hr>.
Some brower specific extensions (IE) allow the attribute.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.