为什么TD不继承BODY? [英] Why does TD not inherit from BODY?

查看:81
本文介绍了为什么TD不继承BODY?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有一个问题'困扰我很长一段时间:为什么TD元素不会继承BODY元素?有什么理由可以解释像font-family这样的属性吗?或font-size如果我将它们分配给BODY元素,则不适用于TD的内容吗?


非常感谢我的启发!


Axel Dahmen

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

推荐答案

" Axel Dahmen" <否**** @ NoOneKnows.de>写道:
"Axel Dahmen" <No****@NoOneKnows.de> wrote:
有一个问题'困扰我很长一段时间:
为什么TD元素不能继承BODY元素?


确实如此。

是否有任何理由可以选择font-family等属性。如果我将它们分配给BODY元素,或者font-size
不适用于TD的内容?
there''s one question that''s been bothering me for a long time:
Why does the TD element not inherit from the BODY element?
It does.
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?




问题在于垃圾浏览器。现代浏览器正确处理继承

,但在许多情况下,您需要指定一个doctype,它将触发标准模式而不是怪癖模式。


史蒂夫


-

我的理论给你起见,我的异端邪说你,

我永远不会回答信件,你不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



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 <st***@pugh.net> <http://steve.pugh.net/>


在文章< be ********** @ sunce.iskon.hr> ;,Berislav Lopac写道:
In article <be**********@sunce.iskon.hr>, Berislav Lopac wrote:
Lasse和Steve很好地解释了它,我只是想让你知道
你可以使用body *选择器解决这些错误,它为所有作为身体后代的元素设置了
风格。
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.




你可能最终得到所有标题相同的大小,除非你

明确设置它们。


-

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·海特? samaa viesti? meilitse ja ryhm ?? n。



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.


Axel Dahmen写道:
Axel Dahmen wrote:
为什么TD元素不会继承自BODY元素?是否存在像font-family这样的属性的原因?或font-size如果我将它们分配给BODY元素,则不适用于TD的内容吗?
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?




其他人已经解释了为什么,这是如何:


表,thead,tbody,tr,td,th {

font-size:inherit;

font-family:inherit;

}


-

David Dorward http://david.us-lot.org/

重新设计正在进行中: http://stone.thecoreworlds.net/

微软宣布IE已死(所以升级):
http:/ /minutillo.com/steve/weblog/20...ces-ie-is-dead



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


这篇关于为什么TD不继承BODY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆