Simple Question?

Discussion in 'HTML' started by Gaffer, Sep 11, 2003.

  1. Gaffer

    Gaffer Guest

    How do change the colour of a horizontal line? <hr>

    Regards
    _____
    Gaffer
    Gaffer, Sep 11, 2003
    #1
    1. Advertising

  2. Gaffer

    Els Guest

    Gaffer wrote:

    > How do change the colour of a horizontal line? <hr>
    >
    > Regards
    > _____
    > Gaffer
    >
    >

    <hr style="color: blue; background-color: blue;">

    --
    Els

    Mente humana é como pára-quedas; funciona melhor aberta.
    Els, Sep 11, 2003
    #2
    1. Advertising

  3. Gaffer

    Richard Guest

    Gaffer wrote:>>

    > How do change the colour of a horizontal line? <hr>


    > Regards
    > _____
    > Gaffer


    Simple answer.
    <hr color="white">
    color can be name as shown, "#fff" -hex 8 bit, ""#ffffff" -hex 16 bit, or
    "rgb(255,255,255)".
    Richard, Sep 11, 2003
    #3
  4. Gaffer

    Adrienne Guest

    Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
    news::

    > Gaffer wrote:>>
    >
    > > How do change the colour of a horizontal line? <hr>

    >
    > > Regards
    > > _____
    > > Gaffer

    >
    > 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.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Sep 11, 2003
    #4
  5. Gaffer

    Sam Hughes Guest

    In article <Xns93F38B10716FCarbpenyahoocom@207.115.63.158>, Adrienne
    says...
    > Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
    > news::
    >
    > > Gaffer wrote:>>
    > >
    > > > How do change the colour of a horizontal line? <hr>

    > >
    > > Simple answer.
    > ><hr color="white">
    > > color can be name as shown, "#fff" -hex 8 bit, ""#ffffff" -hex 16 bit, or
    > > "rgb(255,255,255)".
    > >


    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.

    > Better:
    >
    > <hr style="color:#fff">
    >
    > There is no color attribute for the HR element.


    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.
    Sam Hughes, Sep 11, 2003
    #5
  6. Gaffer

    Adrienne Guest

    Gazing into my crystal ball I observed Sam Hughes <>
    writing in news::

    > In article <Xns93F38B10716FCarbpenyahoocom@207.115.63.158>, Adrienne
    > says...
    >> Gazing into my crystal ball I observed "Richard" <anom@anom> writing
    >> in news::
    >>
    >> > Gaffer wrote:>>
    >> >
    >> > > How do change the colour of a horizontal line? <hr>
    >> >
    >> > Simple answer.
    >> ><hr color="white">
    >> > color can be name as shown, "#fff" -hex 8 bit, ""#ffffff" -hex 16
    >> > bit, or "rgb(255,255,255)".
    >> >

    >
    > 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.
    >
    >> Better:
    >>
    >> <hr style="color:#fff">
    >>
    >> There is no color attribute for the HR element.

    >
    > 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.


    Absolutely agree, I think Els' message hadn't reached my news server yet.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Sep 11, 2003
    #6
  7. Gaffer

    Richard Guest

    Sam Hughes wrote:>>

    > In article <Xns93F38B10716FCarbpenyahoocom@207.115.63.158>, Adrienne
    > says...
    >> Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
    >> news::
    >>
    > >> Gaffer wrote:>>
    > >>
    > > >> How do change the colour of a horizontal line? <hr>
    > >>
    > >> Simple answer.
    > >><hr color="white">
    > >> color can be name as shown, "#fff" -hex 8 bit, ""#ffffff" -hex 16 bit,
    > >> or "rgb(255,255,255)".


    > 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).


    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".




    > #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.


    It is supported in versions 4 and above. In IE, netscape and mozilla as well
    as others.

    > 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.


    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.
    So "red" has 65,005 shades.
    Although we refer to it as 24 bit "true color", it is not 24 bit in the
    formatting. Not yet anyway.



    >> Better:
    >>
    >> <hr style="color:#fff">
    >>
    >> There is no color attribute for the HR element.


    > 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.
    Richard, Sep 12, 2003
    #7
  8. Gaffer

    Richard Guest

    Adrienne wrote:>>

    > Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
    > news::


    >> Gaffer wrote:>>
    >>
    > >> How do change the colour of a horizontal line? <hr>

    >>
    > >> Regards
    > >> _____
    > >> Gaffer

    >>
    >> 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.


    Then to tell that to this guy:
    http://www.webdiner.com/annexe/hr/hr.htm
    Richard, Sep 12, 2003
    #8
  9. Gaffer

    Mark Parnell Guest

    Mark Parnell, Sep 12, 2003
    #9
  10. Gaffer

    rf Guest

    "Richard" <anom@anom> wrote in message
    news:...
    > Adrienne wrote:>>
    >
    > > Gazing into my crystal ball I observed "Richard" <anom@anom> writing in
    > > news::

    >
    > > There is no color attribute for the HR element.

    >
    > Then to tell that to this guy:
    > http://www.webdiner.com/annexe/hr/hr.htm


    <grin />
    Yes. We should also tell him this:

    http://www.w3.org/TR/html4/present/graphics.html#h-15.3

    I see no mention of a color attribute anywhere in the DTD entry for <hr>.

    Some brower specific extensions (IE) allow the attribute.

    Cheers
    Ricahrd.
    rf, Sep 12, 2003
    #10
  11. Richard wrote:

    > 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".


    What, did you fail math?

    Each hex digit can have a value from 0 to F (15). In binary, the
    smallest (fewest-digits) representation is 0000 to 1111.

    So how many hex digits do you get out of eight bits? 0011 1100 == #3C
    [0]. #123 is, in fact, *three* groups of four bits. Twelve bits. Not
    eight bits.

    The logical leap from that to the size of #123456 is left as an
    excercise to the reader.

    > > #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.

    >
    > It is supported in versions 4 and above. In IE, netscape and mozilla
    > as well as others.


    Just because something is supported does not make it correct[1]. The
    HTML specification, as published by the W3C, only permits six-digit hex
    codes in the format #000000 and the sixteen keywords for colour.

    The CSS specification, however, permits the wider range of colour
    values, in the context of style attributes, style elements, and
    external stylesheets. It says nothing at all about attribute values on
    elements themselves.

    > In using rgb(00,00,00), the 3 sets of values automatically define it
    > as 24 bit.


    No, the three values are integers ranging from 0 to 255. The
    difference is subtle, but important.

    > 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.


    So far, so good. Each of the three colour components in this notation
    can have 256 (0-255 inclusive) values.

    > 16 bits therefor = 65,005 possible combinations.


    There's still three of them. Not two.

    <snip the rest, it's incoherent>

    Owen

    [0] We're using HTML/CSS notation here, not C notation (0x..).

    [1] <blink>
    Owen Jacobson, Sep 12, 2003
    #11
  12. Gaffer

    Richard Guest

    rf wrote:>>


    > "Richard" <anom@anom> wrote in message
    > news:...
    >> Adrienne wrote:>>
    >>
    > >> Gazing into my crystal ball I observed "Richard" <anom@anom> writing
    > >> in news::

    >>
    > >> There is no color attribute for the HR element.

    >>
    >> Then to tell that to this guy:
    >> http://www.webdiner.com/annexe/hr/hr.htm


    > <grin />
    > Yes. We should also tell him this:


    > http://www.w3.org/TR/html4/present/graphics.html#h-15.3


    > I see no mention of a color attribute anywhere in the DTD entry for <hr>.


    > Some brower specific extensions (IE) allow the attribute.


    The statement was that it could not be done.


    > Cheers
    > Ricahrd.
    Richard, Sep 12, 2003
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    550
  2. Kevin Spencer

    Re: Simple Simple question!!!

    Kevin Spencer, Jun 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    655
    Kevin Spencer
    Jun 25, 2004
  3. Daniel Frey

    Simple Question - Simple Answer?

    Daniel Frey, Dec 28, 2004, in forum: XML
    Replies:
    4
    Views:
    835
    Daniel Frey
    Jan 12, 2005
  4. Oli

    simple simple question

    Oli, Jan 26, 2004, in forum: ASP General
    Replies:
    10
    Views:
    367
    Roland Hall
    Jan 26, 2004
  5. Peter Bailey

    simple, simple array question

    Peter Bailey, Apr 8, 2008, in forum: Ruby
    Replies:
    7
    Views:
    210
    Peter Bailey
    Apr 8, 2008
Loading...

Share This Page