Connecting Tech Pros Worldwide Help | Site Map

Why does TD not inherit from BODY?

  #1  
Old July 20th, 2005, 08:48 PM
Axel Dahmen
Guest
 
Posts: n/a
Hi,

there's one question that's been bothering me for a long time: Why does the TD element not inherit from the BODY element? Is there any reason why properties like "font-family" or "font-size" are not applied to content of TD if I assign them to the BODY element?

Thanks a lot for enlightening me!

Axel Dahmen

  #2  
Old July 20th, 2005, 08:48 PM
Steve Pugh
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


"Axel Dahmen" <NoSpam@NoOneKnows.de> wrote:
[color=blue]
>there's one question that's been bothering me for a long time:
>Why does the TD element not inherit from the BODY element?[/color]

It does.
[color=blue]
>Is there any reason why properties like "font-family" or "font-size"
>are not applied to content of TD if I assign them to the BODY element?[/color]

The problem is with crap browsers. Modern browsers handle inheritence
correctly, but in many cases you need to specify a doctype that will
trigger standards mode rather than quirks mode.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
  #3  
Old July 20th, 2005, 08:48 PM
Lauri Raittila
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


In article <bea01q$ac9$1@sunce.iskon.hr>, Berislav Lopac wrote:
[color=blue]
> Lasse and Steve explained it excellently, and I just want to let you know
> that you can work around such bugs using the body * selector, which sets the
> style for all elements which are descendents of body.[/color]

And you might end up with having all headers same size, unless you
explicitly set them.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

  #4  
Old July 20th, 2005, 08:49 PM
David Dorward
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


Axel Dahmen wrote:
[color=blue]
> Why does the TD element not inherit from the BODY element? Is there any
> reason why properties like "font-family" or "font-size" are not applied to
> content of TD if I assign them to the BODY element?[/color]

Other people have explained the why, this is the how:

table, thead, tbody, tr, td, th {
font-size: inherit;
font-family: inherit;
}

--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
  #5  
Old July 20th, 2005, 08:53 PM
Axel Dahmen
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


Thanks a lot to all of you for your valuable and versatile answers. You've been a great help to me.

Now there's one thing I don't understand: "quirks mode" and "standard mode" seem to have become a technical term. I don't understand their meaning in terms of a browser's mode. How do I set a browser to one or the other? Or is it just a label for a style definition like the one David Dorward posted:
[color=blue]
> Other people have explained the why, this is the how:
>
> table, thead, tbody, tr, td, th {
> font-size: inherit;
> font-family: inherit;
> }[/color]

TIA,
Axel Dahmen

  #6  
Old July 20th, 2005, 08:53 PM
Geoff Ball
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


Axel Dahmen <bf4qsu$873$1@online.de> wrote in
comp.infosystems.www.authoring.stylesheets:
[color=blue]
> Now there's one thing I don't understand: "quirks mode" and "standard
> mode" seem to have become a technical term. I don't understand their
> meaning in terms of a browser's mode. How do I set a browser to one or the
> other?[/color]

http://www.mozilla.org/docs/web-developer/quirks/
http://dbaron.org/mozilla/quirklist
http://www.hut.fi/u/hsivonen/doctype.html
http://developer.apple.com/internet/html/doctype.html
http://nontroppo.org/wiki/OperaQuirksMode
http://diveintomark.org/archives/200...irks_mode.html
http://www.htmlhelp.com/tools/validator/doctype.html

Regards,
Geoff

--
http://www.doctype.ca/
http://www.allmyfaqs.com/faq.pl?Geoff_Ball
  #7  
Old July 20th, 2005, 08:53 PM
Richard Barnet
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


"Geoff Ball" <usenet@doctype.ca> wrote in message
news:3160181.TuWkE2YOz3@doctype.ca...[color=blue]
>
> http://www.mozilla.org/docs/web-developer/quirks/
> http://dbaron.org/mozilla/quirklist
> http://www.hut.fi/u/hsivonen/doctype.html
> http://developer.apple.com/internet/html/doctype.html
> http://nontroppo.org/wiki/OperaQuirksMode
> http://diveintomark.org/archives/200...irks_mode.html
> http://www.htmlhelp.com/tools/validator/doctype.html
>[/color]

Much better. =)

-- Richard


  #8  
Old July 20th, 2005, 08:53 PM
Geoff Ball
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


Richard Barnet <bf4rcr$2g0$1@nnrp.atgi.net> wrote in
comp.infosystems.www.authoring.stylesheets:
[color=blue]
> "Axel Dahmen" <NoSpam@NoOneKnows.de> wrote in message
> news:bf4qsu$873$1@online.de...
>[color=green]
>> Now there's one thing I don't understand: "quirks mode" and "standard[/color]
> mode" seem to[color=green]
>> have become a technical term. I don't understand their meaning in terms
>> of[/color]
> a browser's[color=green]
>> mode. How do I set a browser to one or the other?[/color]
>
> As far as I understand it, it's an MSIE thing.[/color]

Mozilla and Opera, among others, have both modes as well.
[color=blue]
> IE6 (at least) 'switches' modes according to the DOCTYPE you use on the
> first line of your page(s).[/color]

It's rather weird in how it determines which mode to go into. If you put
anything before the doctype, it goes into Quirks mode, regardless of if
your doctype was proper or not. See
<URL:http://www.hut.fi/u/hsivonen/doctype.html> for more info.
[color=blue]
> If you don't have a DOCTYPE at all, IE goes into "quirks" mode and thus
> supports older (non-strict) HTML and buggy code. If you have a valid
> DOCTYPE (i.e., <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
> Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">), then it goes
> into 'standards' mode, which requires compliant coding, etc.[/color]

You can have a perfectly valid doctype, even with a URL, and still have a
browser go into Quirks mode.

The biggest issue between standards and quirks mode is how IE interprets the
box model.

Regards,
Geoff

--
http://www.doctype.ca/
http://www.allmyfaqs.com/faq.pl?Geoff_Ball
  #9  
Old July 20th, 2005, 08:53 PM
Jacqui or (maybe) Pete
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


In article <bf4rrj$2h8$1@nnrp.atgi.net>, rbarnet@csaNOSPAMreno.org
says...[color=blue]
> "Geoff Ball" <usenet@doctype.ca> wrote in message
> news:3160181.TuWkE2YOz3@doctype.ca...[color=green]
> >[/color][/color]
....[color=blue][color=green]
> > http://nontroppo.org/wiki/OperaQuirksMode[/color][/color]
....
The trick of typing
javascript:alert(document.compatMode);
into the address bar mentioned in the document above also works in
Mozilla & IE6.

It's easy to create a bookmarklet for it (at least in Mozilla) by
setting the url of any existing bookmark (make one for the purpose) to
the value above.
  #10  
Old July 20th, 2005, 08:53 PM
Jukka K. Korpela
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


David Dorward <dorward@yahoo.com> wrote:
[color=blue]
> Other people have explained the why, this is the how:
>
> table, thead, tbody, tr, td, th {
> font-size: inherit;
> font-family: inherit;
> }[/color]

I'm sorry to comment on this so late (but summer time is an excuse for
everything, isn't it?), but that doesn't really help anything, as far
as I can see. Browsers that fail to obey inheritance rules generally
don't recognize the inherit keyword either; it's an CSS 2 "novelty".

What you _can_ do to make old browsers behave in this issue is to use

body, caption, th, td {
font-size: ...;
font-family: ...; }

where ... stands for whatever global settings you wish to make. (Adding
table, thead, tbody, tr is superfluous, since caption, th, td directly
captures any content in a table).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
  #11  
Old July 20th, 2005, 08:53 PM
Richard Barnet
Guest
 
Posts: n/a

re: Why does TD not inherit from BODY?


"Jacqui or (maybe) Pete" <porjes@spamcop.net> wrote in message
news:MPG.198059aed1f6b86e989c4d@news.CIS.DFN.DE...[color=blue]
>
> It's easy to create a bookmarklet for it (at least in Mozilla) by
> setting the url of any existing bookmark (make one for the purpose) to
> the value above.[/color]

This also is the same in Windows/MSIE. Works great! Excellent suggestion
and tip.

=)

-- Richard


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Php Upload script not working camphor answers 5 May 28th, 2008 07:52 PM
how do I implement font size using ems so that they can resize in ie 6 on a pc newspost2000@yahoo.com answers 12 April 20th, 2006 11:15 PM
CASCADEand INHERITED properties in Explorer v Firefox Jim Flack answers 7 July 21st, 2005 01:41 AM
Works in ie and opera not mozilla tony kulik answers 10 July 20th, 2005 12:26 PM