|
Author |
Message |
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Mon May 26, 2003 10:21 am (20 years, 11 months ago) |
|
Hi,
I'm confused about background-color. In order to have valid CSS it needs to be declared with all selectors/classes, right?
If I use the following code, I get white text with a transparent background (transparent taking its colour from the body element) . But what if I want to change the colour of the table row in which this text sits? This .class is used on different pages, so controlling the table row colour is not possible as the code stands.
Code: |
.body {
color: #FFFFFF;
background-color: transparent;
font-family: tahoma, sans-serif;
font-size: 8pt;
} |
What can I do to get around this and still be valid? Or is it okay to ignore background-color errors?
Any info much appreciated!
Ta,
Anil |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Mon May 26, 2003 1:19 pm (20 years, 11 months ago) |
|
the background-color messages are warnings, not errors...so your code is valid if you ignore them. However, it's better, in my opinion, not to have any warnings. I'm confused as to what your problem is...how does using this code prevent you from changing the colour of a table row? |
________________________________ It's turtles all the way down... |
|
|
|
GunstarHero
Junior WebHelper
Joined: 15 Apr 2003
Posts: 35
|
Posted:
Mon May 26, 2003 1:26 pm (20 years, 11 months ago) |
|
Cheers Adam,
The problem is, if I declare, background-transparent in the .class, this seems to override any colour settings I want to apply to the table row where I use that .class statement. At least this is what seems to happen and I was confused so I thought I'd ask.
I'll take another look at the CSS and my table tomorrow.
Cheers!
Anil |
|
|
|
|
verto
Senior WebHelper
Joined: 14 Jan 2002
Posts: 220
Location: Cambridge MA USA
|
Posted:
Tue May 27, 2003 3:36 pm (20 years, 11 months ago) |
|
Try applying the class inside another tag INSIDE the cell (take it OFF the cell also):
Code: | <tr><td><p class="body">your text here</p></td></tr> |
That works in IE6 anyway |
________________________________ >>>>>>>>>>>>>
GENERAL DISCLAIMER:This disclaimer may be void where null in all cases unless explicitly not unprohibited or (p)re-exclusively assigned by sufficient presedimentation on behalf of every non-interested party to wit (or so it was said).
:::
.: :. . : :....: :.: .: :. verto .: :. . : :....: :.: .: :. |
|
|
|
montroze
Junior WebHelper
Joined: 18 Jun 2003
Posts: 1
Location: Canada
|
Posted:
Wed Jun 18, 2003 6:06 am (20 years, 10 months ago) |
|
Here's what a validator comes up with,
CSSCheck Results
Quote: | .body {
color: #FFFFFF;
background-color: transparent;
font-family: tahoma, sans-serif;
font-size: 8pt;
}
Warning: To help avoid conflicts with user style sheets, background-image should be specified whenever background-color is used. In most cases, background-image: none is suitable.
background-color: transparent
Warning: The shorthand background property is more widely supported than background-color.
font-size: 8pt
Warning: Absolute length units should not generally be used on the Web, since the physical properties of the output medium are almost always unknown. |
|
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.17828 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |