身体vs html [英] body vs html

查看:69
本文介绍了身体vs html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您在Yahoo.com上显示正在使用的样式,您可以看到一些有趣的东西。例如,这个:

html> body {font:84.5%/ 122%arial;}

我尝试使用这种风格创建示例页面并且它没有做任何事b / b
。任何人都知道是否有这个>是真正的代码还是语法

错误?我不确定那是什么/也有字体样式。或者

样式表在html样式和正文样式之间的差异。

查找讨论这些高级主题的CSS参考将有助于

我很了不起有人能指点我一本书或在线

参考讨论这些吗?谢谢。

If you display the styles in use at Yahoo.com, you can see some
interesting things. For example, this:
html>body{font:84.5%/122% arial;}
I tried creating a sample page using this style and it didn''t do
anything. Anyone know whether having this ">" is real code or a syntax
error? I''m not sure what that "/" does in the font style, either. Or
the difference in a stylesheet between an html style and a body style.
Finding a CSS reference that discusses these advanced topics would help
me a great deal. Could someone point me to a book or an on-line
reference that discusses these? Thanks.

推荐答案

Joe写道:
如果你在Yahoo.com上显示使用的样式,你可以看到一些有趣的东西。例如,这个:
html> body {font:84.5%/ 122%arial;}
我尝试使用这种风格创建一个示例页面,它没有做任何事情。


语法


X> Y(或X> Y)


表示 ; Y是X的直接子项。它与


XY


不同,这意味着在*任何*级别的X中包含一个Y。


虽然Internet Explorer认为X> Y'QUOT;是X Y (IIRC),

错误地解释它,它忽略了X> Y。共。这使得


X> Y {/ *某些属性* /}

a hack用于某些属性应设置为某些<浏览器,但不是IE浏览器。


回到你的观察:如果你正在使用IE,确切地说 -

声明无效。


任何人都知道是否有这个>是真正的代码还是语法
错误?我不确定那是什么/也有字体样式。


简写字体:字体:84.5%/ 122%arial"意思相同


字体大小:84.5%;

行高:122%;

font-family :arial



样式表在html样式和body样式之间的区别。


在这种特殊情况下,由于HTML标记是BODY

标记的父标记,因此html> body是专门声明页面范围样式的方法对于

非IE浏览器。

查找讨论这些高级主题的CSS参考将对我有所帮助。有人能指点我讨论这些书的书或在线
参考吗?谢谢。
If you display the styles in use at Yahoo.com, you can see some
interesting things. For example, this:
html>body{font:84.5%/122% arial;}
I tried creating a sample page using this style and it didn''t do
anything.
The syntax

X>Y (or X > Y)

means "a Y that is an immediate child of an X". It''s different from

X Y

which means "a Y that is contained in X at *any* level".

While Internet Explorer thinks that "X > Y" is "X Y" (IIRC),
interpreting it wrongly, it ignores "X>Y" altogether. This makes

X>Y { /* some properties */ }

a hack for situations where properties should be set for use by some
browsers but not by IE.

Getting back to your observation: if you''re using IE, exactly--the
declaration will have no effect.

Anyone know whether having this ">" is real code or a syntax
error? I''m not sure what that "/" does in the font style, either.
The shorthand "font: 84.5%/122% arial" means the same thing as

font-size: 84.5%;
line-height: 122%;
font-family: arial

Or
the difference in a stylesheet between an html style and a body style.
In this particular case, since the HTML tag is the parent of the BODY
tag, html>body is the way to declare page-wide styles specifically for
non-IE browsers.
Finding a CSS reference that discusses these advanced topics would help
me a great deal. Could someone point me to a book or an on-line
reference that discusses these? Thanks.




关于CSS的一切都在 http://www.w3.org/TR/CSS2/



Everything about CSS is explained at http://www.w3.org/TR/CSS2/.


Joe写道:
如果您在Yahoo.com上显示正在使用的样式,您可以看到一些有趣的东西。例如,这个:
html> body {font:84.5%/ 122%arial;}
我尝试使用这种风格创建一个示例页面,它没有做任何事情。任何人都知道是否有这个>是真正的代码还是语法
错误?我不确定那是什么/也有字体样式。或者
样式表在html样式和正文样式之间的区别。
查找讨论这些高级主题的CSS参考将对我有所帮助。有人能指点我讨论这些书的书或在线
参考吗?谢谢。
If you display the styles in use at Yahoo.com, you can see some
interesting things. For example, this:
html>body{font:84.5%/122% arial;}
I tried creating a sample page using this style and it didn''t do
anything. Anyone know whether having this ">" is real code or a syntax
error? I''m not sure what that "/" does in the font style, either. Or
the difference in a stylesheet between an html style and a body style.
Finding a CSS reference that discusses these advanced topics would help
me a great deal. Could someone point me to a book or an on-line
reference that discusses these? Thanks.




对于初学者:
http://www.w3.org/TR/CSS2/selector.html#child-selectors
http://www.w3.org/TR/CSS21/fonts.html#font-简写


- 先生。 Wilson



For starters:
http://www.w3.org/TR/CSS2/selector.html#child-selectors
http://www.w3.org/TR/CSS21/fonts.html#font-shorthand

--Mr. Wilson


感谢您的回复。虽然W3

的参考文件有点难以排序,但它确实为我提供了我需要继续的

术语。因此我找到了>我自己的符号

CSS参考文章名为A A A A A A />。


根据你的答案,我假设HTML风格和BODY风格,当他们自己使用
时,它们是等价且可以互换的 - 尽管

在雅虎这样看过:


html {...}

body {...}

Thank you for your very helpful response. While that reference at W3
is a little hard to sort through, it does provide me with the
terminology I need to proceed. I thus found the ">" notation in my own
CSS reference under a chapter called "A Look Ahead".

Based on your answer, I assume that the HTML style and BODY style, when
used by themselves, are equivalent and interchangeable -- in spite of
seeing both at Yahoo like this:

html { ... }
body { ... }


这篇关于身体vs html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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