4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 CSS background-color?
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Mon May 26, 2003 10:21 am (14 years, 5 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Mon May 26, 2003 1:19 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
GunstarHero
Junior WebHelper
Junior WebHelper


Joined: 15 Apr 2003
Posts: 35

PostPosted: Mon May 26, 2003 1:26 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by GunstarHeroSend Personal Message
verto
Senior WebHelper
Senior WebHelper


Joined: 14 Jan 2002
Posts: 220
Location: Cambridge MA USA

PostPosted: Tue May 27, 2003 3:36 pm (14 years, 5 months ago) Reply with QuoteBack to Top

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 Wink

________________________________
>>>>>>>>>>>>>
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 .: :. . : :....: :.: .: :.
OfflineView User's ProfileFind all posts by vertoSend Personal Message
montroze
Junior WebHelper
Junior WebHelper


Joined: 18 Jun 2003
Posts: 1
Location: Canada

PostPosted: Wed Jun 18, 2003 6:06 am (14 years, 4 months ago) Reply with QuoteBack to Top

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.
OfflineView User's ProfileFind all posts by montrozeSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.080517 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme