Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > problem with css

Reply
Thread Tools

problem with css

 
 
Thomas Müller
Guest
Posts: n/a
 
      03-17-2007
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



 
Reply With Quote
 
 
 
 
scripts.contact@gmail.com
Guest
Posts: n/a
 
      03-17-2007
On Mar 17, 5:14 am, "Thomas Müller" <(E-Mail Removed)> 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-colorxxxxx



 
Reply With Quote
 
 
 
 
Thomas Müller
Guest
Posts: n/a
 
      03-17-2007
Thanks, it works.

Tom


 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      03-17-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> On Mar 17, 5:14 am, "Thomas Müller" <(E-Mail Removed)> 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-colorxxxxx
>
>


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


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
scripts.contact@gmail.com
Guest
Posts: n/a
 
      03-17-2007
On Mar 17, 7:07 am, "Jonathan N. Little" <(E-Mail Removed)>
wrote:
> >> in the styles.css is BG defined:
> >> .BG { bgcolor: C00000 }

>
> > BGCOLOR is a HTML attribute not CSS. In CSS, use-
> > background-colorxxxxx

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


yes, i forgot that...
and color names are also valid like-
red,black,lime,green etc.


 
Reply With Quote
 
Bergamot
Guest
Posts: n/a
 
      03-17-2007
(E-Mail Removed) wrote:
> On Mar 17, 7:07 am, "Jonathan N. Little" <(E-Mail Removed)>
> 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
 
Reply With Quote
 
=?ISO-8859-1?Q?G=E9rard_Talbot?=
Guest
Posts: n/a
 
      03-17-2007
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...your_Web_Pages

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
confused - html validates, css validates but validate css from the html causes errors Titus A Ducksass - AKA broken-record HTML 6 11-15-2004 12:59 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments