HighDots Forums  

Can I remove the default font and color info from a TABLE?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Can I remove the default font and color info from a TABLE? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Will Hartung
 
Posts: n/a

Default Can I remove the default font and color info from a TABLE? - 05-16-2006 , 12:23 AM






I have a simple rule:

..main p { font-size: small; color: red;}

But if I put a paragraph in a TABLE, it basically comes out black and a
different size.

I found if I did:

..main table { font-size: small; color: red;}

then I got the right formatting.

Am I forced to tell the TABLE to, well, "get out of the way"? I tried:

..main table {font: none; color: none; }

but that didn't do anything.

Thanx!

Regards,

Will Hartung



Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 01:56 AM






Will Hartung wrote:

Quote:
I have a simple rule:

.main p { font-size: small; color: red;}

But if I put a paragraph in a TABLE, it basically comes out black and a
different size.
What odd tabular data you have, but you shouldn't see that effect
since "small" is an absolute value.

The three possibilities I can see (oh, this would be so much easier if you
provided URLs) are that:

(1) You are trying to put the text of the paragraph inside the table, then
the table inside the paragraph - which isn't possible as paragraph elements
cannot contain table elements. This is one of the times the validator
becomes a useful tool as it would complain about the end tag for the
paragraph being where it isn't allowed, and the parse tree view would show
the paragraph ending before the table opened.

(2) You have a selector more specific than ".main p" overriding your other
style. The Firefox DOM Inspector will show you which styles are being
applied to a given element, and in what order.

Quote:
Am I forced to tell the TABLE to, well, "get out of the way"? I tried:
.main table {font: none; color: none; }
but that didn't do anything.
Which is unsurprising, you can't just make up syntax and expect it to work.

http://jigsaw.w3.org/css-validator/v...usermedium=all

However if you RTFM ...

http://www.w3.org/TR/CSS2/colors.html#colors

.... that the color property can take a color, or "inherit" as its value (and
something similar applies to the font property).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #3  
Old   
Mark Parnell
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 02:09 AM



Deciding to do something for the good of humanity, David Dorward
<dorward (AT) yahoo (DOT) com> declared in
comp.infosystems.www.authoring.stylesheets:

Quote:
The three possibilities I can see (oh, this would be so much easier if you
provided URLs) are that:

(1) You are trying to put the text of the paragraph inside the table, then
snip
(2) You have a selector more specific than ".main p" overriding your other
style.
snip

And number 3 is...? ;-)

--
Mark Parnell
My Usenet is improved; yours could be too:
http://blinkynet.net/comp/uip5.html


Reply With Quote
  #4  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 02:14 AM



"Will Hartung" <redrocks (AT) sbcglobal (DOT) net> wrote:

Quote:
I have a simple rule:

.main p { font-size: small; color: red;}
And what is your URL? CSS alone does not do anything. It needs an HTML (or
XML) document to which it will be applied. Besides, the rule is very bad
practice on several accounts: setting font size to small for something that
is apparently copy text, setting color without setting background, and
setting color to red. Maybe it's "just an example", but do all examples need
to be bad examples?

Quote:
But if I put a paragraph in a TABLE, it basically comes out black and a
different size.
Perhaps. This depends on the browser and its (hypothetical) default style
sheet. It also depends on the actual markup used as well as what your style
sheet as a whole really contains (as opposite to the potentially mistyped
extracts you've posted).

Quote:
I tried:

.main table {font: none; color: none; }

but that didn't do anything.
Are you surprised? What did you expect? CSS isn't about inventing new
constructs and wishing they'll magically work. Otherwise we would all use
* { *: dwim; }
or something like that. What you probably meant was the special value
inherit (instead of none). It exists in the specs, but it's poorly
supported.



Reply With Quote
  #5  
Old   
Barbara de Zoete
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 02:29 AM



On Tue, 16 May 2006 07:56:05 +0200, David Dorward <dorward (AT) yahoo (DOT) com>
wrote:

Quote:
The three possibilities I can see [...] are that:

(1) [...]

(2) [...]
<intrigued />


--
______PretLetters:

Reply With Quote
  #6  
Old   
David Dorward
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 02:48 AM



Barbara de Zoete wrote:

Quote:
On Tue, 16 May 2006 07:56:05 +0200, David Dorward <dorward (AT) yahoo (DOT) com
wrote:

The three possibilities I can see [...] are that:

(1) [...]

(2) [...]

intrigued /
Damnit - I thought I'd gone back an edited it back to two after deciding
that the third idea was impossible and not worth mentioning.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #7  
Old   
Barbara de Zoete
 
Posts: n/a

Default Re: Can I remove the default font and color info from a TABLE? - 05-16-2006 , 04:25 AM



On Tue, 16 May 2006 08:48:43 +0200, David Dorward <dorward (AT) yahoo (DOT) com>
wrote:

Quote:
Barbara de Zoete wrote:

On Tue, 16 May 2006 07:56:05 +0200, David Dorward <dorward (AT) yahoo (DOT) com
wrote:

The three possibilities I can see [...] are that:

(1) [...]

(2) [...]

intrigued /

Damnit - I thought I'd gone back an edited it back to two
I know how that happens :-)

Quote:
after deciding
that the third idea was impossible
Well, still intrigued. Maybe even more so than earlier, before you
responded :-)

Quote:
and not worth mentioning.
Aww, pitty.

--
______PretLetters:

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.