XHTML标准的基本原理问题 [英] XHTML standard rationale question

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

问题描述

为什么标准要求某些元素具有某些子元素?b $ b元素?例如,< head>元素必须有< title>元素

作为孩子,< table>必须至少有一个< tr>儿童元素。


-

Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我

ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。

Why does the standard require that certain elements have certain child
elements? For example, the <head> element must have a <title> element
as a child, and <table> must have at least one <tr> child element.

--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.

推荐答案

Christopher Benson-Manica写道:
Christopher Benson-Manica wrote:
为什么标准要求某些元素有某些孩子
元素?例如,< head>元素必须有< title>元素
作为孩子,< table>必须至少有一个< tr>子元素。
Why does the standard require that certain elements have certain child
elements? For example, the <head> element must have a <title> element
as a child, and <table> must have at least one <tr> child element.




因为符合逻辑:

1.每个文件都必须有标题?

2.每张桌子必须有一排桌子?


-

Gus



Because it is logical that:
1. Every document must have a title?
2. Every Table must have a Table Row?

--
Gus


Christopher Benson -Manica< at *** @ nospam.cyberspace.org>写道:
Christopher Benson-Manica <at***@nospam.cyberspace.org> wrote:
为什么标准要求某些元素具有某些子元素?例如,< head>元素必须有< title>元素
作为孩子,< table>必须至少有一个< tr>子元素。
Why does the standard require that certain elements have certain child
elements? For example, the <head> element must have a <title> element
as a child, and <table> must have at least one <tr> child element.




您提供的两个示例也是HTML中的重新获得,而不仅仅是

XHTML。

转动你的问题 -

为什么文件不存在标题?

为什么表格中没有任何行?

史蒂夫


-

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

我从不回信,你也不喜欢我的领带。 - 医生


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



The two examples you give are also rerquirements in HTML, not just in
XHTML.

To turn your questions around-
Why should a document exist without a title?
Why should a table exist without any rows?

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/>


Christopher Benson-Manica写道:
Christopher Benson-Manica wrote:
为什么标准要求某些元素具有某些子元素?


HTML和XHTML都要求孩子使用某些元素。我认为有些元素没有内容就没有意义。


例如,一个段落并不是很多没有文字的段落

的内容。虽然HTML规范允许一个空的P元素,但它确实不鼓励它们,并建议用户代理忽略它们。我希望内容不是必需的,因为遗留文件中使用了空段

黑客。

例如,< head> ;元素必须有< title>元素作为孩子,


正如HTML规范在下面的引文中所暗示的那样

(< URL:http://www.w3.org/TR /html4/struct/global.html#h-7.4.2>),

TITLE元素有一个重要的目的,从可访问性

的角度来看。 TITLE元素对于搜索

引擎也非常重要。


出于可访问性的原因,用户代理必须始终使用

用户可用的TITLE元素内容


由于任何合理的文档都有标题,HTML文档应该有一个

TITLE元素。此外,为了使用户代理符合引用的

语句,文档必须具有可用的标题。

和< table>必须至少有一个< tr>子元素。
Why does the standard require that certain elements have certain child
elements?
Both HTML and XHTML require children for certain elements. I''m of the
opinion that some elements don''t make sense without content.

For example, a paragraph isn''t much of a paragraph without text
content. Whilst the HTML Specification allows an empty P element, it
does discourage them and suggests that user agents ignore them. I
expect that content isn''t a requirement because of empty paragraph
hacks used in legacy documents.
For example, the <head> element must have a <title> element as a child,
As the HTML Specification implies in the quote below
(<URL:http://www.w3.org/TR/html4/struct/global.html#h-7.4.2>), the
TITLE element has an important purpose from an accessibility
perspective. The TITLE element is also extremely important for search
engines.

"For reasons of accessibility, user agents must always make the
content of the TITLE element available to users"

As any reasonable document has a title, an HTML document should have a
TITLE element. Moreover, for a user agent to conform with the quoted
statement, a document must have a title to make available.
and <table> must have at least one <tr> child element.




表格是我之前所说的一个非常好的例子:没有任何内容,它不是非常有意义的b $ b是吗?


迈克


-

Michael Winter

替换"。无效"与.uk通过电子邮件回复。



A table is a very good example of what I said previously: it isn''t
very meaningful without any content, is it?

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


这篇关于XHTML标准的基本原理问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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