problem with css

Discussion in 'HTML' started by Thomas Müller, Mar 17, 2007.

  1. Hello,

    the following HTML works:

    <td bgcolor="C00000">Test</td>

    the following doesn't work:

    <td class="BG">Test</td>

    in the styles.css is BG defined:

    .BG { bgcolor: C00000 }

    what's my fault?

    Thanks in advance,

    Tom
    Thomas Müller, Mar 17, 2007
    #1
    1. Advertising

  2. Thomas Müller

    Guest

    On Mar 17, 5:14 am, "Thomas Müller" <> wrote:
    > Hello,
    >
    > the following HTML works:
    > <td bgcolor="C00000">Test</td>
    >
    > the following doesn't work:
    > <td class="BG">Test</td>
    >
    > in the styles.css is BG defined:
    > .BG { bgcolor: C00000 }
    >


    BGCOLOR is a HTML attribute not CSS. In CSS, use-
    background-color:xxxxxx
    , Mar 17, 2007
    #2
    1. Advertising

  3. Thanks, it works.

    Tom
    Thomas Müller, Mar 17, 2007
    #3
  4. wrote:
    > On Mar 17, 5:14 am, "Thomas Müller" <> wrote:
    >> Hello,
    >>
    >> the following HTML works:
    >> <td bgcolor="C00000">Test</td>
    >>
    >> the following doesn't work:
    >> <td class="BG">Test</td>
    >>
    >> in the styles.css is BG defined:
    >> .BG { bgcolor: C00000 }
    >>

    >
    > BGCOLOR is a HTML attribute not CSS. In CSS, use-
    > background-color:xxxxxx
    >
    >


    Correction: background-color: #xxxxxx
    ^
    Put '#' before the 'C00000'


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Mar 17, 2007
    #4
  5. Thomas Müller

    Guest

    On Mar 17, 7:07 am, "Jonathan N. Little" <>
    wrote:
    > >> in the styles.css is BG defined:
    > >> .BG { bgcolor: C00000 }

    >
    > > BGCOLOR is a HTML attribute not CSS. In CSS, use-
    > > background-color:xxxxxx

    >
    > Correction: background-color: #xxxxxx
    > ^
    > Put '#' before the 'C00000'
    >


    yes, i forgot that...
    and color names are also valid like-
    red,black,lime,green etc.
    , Mar 17, 2007
    #5
  6. Thomas Müller

    Bergamot Guest

    wrote:
    > On Mar 17, 7:07 am, "Jonathan N. Little" <>
    > wrote:
    >>
    >> background-color: #xxxxxx

    >
    > and color names are also valid like-
    > red,black,lime,green etc.


    Note that CSS 2.1 only has 16 valid color names.
    http://www.w3.org/TR/CSS21/syndata.html#color-units

    The big X11 list of colors is supposedly part of the CSS3 spec. While
    they may be widely supported already, using a hex or rgb value is more
    reliable. Besides, graphics editors tend to require numeric references.

    --
    Berg
    Bergamot, Mar 17, 2007
    #6
  7. Thomas Müller wrote :
    > Hello,
    >
    > the following HTML works:
    >
    > <td bgcolor="C00000">Test</td>
    >
    > the following doesn't work:
    >
    > <td class="BG">Test</td>
    >
    > in the styles.css is BG defined:
    >
    > .BG { bgcolor: C00000 }
    >
    > what's my fault?
    >
    > Thanks in advance,
    >
    > Tom


    This particular issue and many others are explained, addressed at

    Using Web Standards in your Web Pages (Updated Dec. 2006)
    http://developer.mozilla.org/en/docs/Using_Web_Standards_in_your_Web_Pages

    Gérard
    --
    Using Web Standards in your Web Pages (Updated Dec. 2006)
    http://developer.mozilla.org/en/docs/Using_Web_Standards_in_your_Web_Pages
    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Mar 17, 2007
    #7
    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. Eric
    Replies:
    4
    Views:
    711
    clintonG
    Dec 24, 2004
  2. tom watson

    print.css and screen.css

    tom watson, Sep 9, 2003, in forum: HTML
    Replies:
    1
    Views:
    461
    Jukka K. Korpela
    Sep 9, 2003
  3. Joshua Beall
    Replies:
    1
    Views:
    425
    Bertilo Wennergren
    Dec 10, 2003
  4. Noozer
    Replies:
    10
    Views:
    2,084
    Mitja
    Oct 13, 2004
  5. Titus A Ducksass - AKA broken-record
    Replies:
    6
    Views:
    649
    Titus A Ducksass - AKA broken-record
    Nov 15, 2004
Loading...

Share This Page