HTML W3C有效元素 - DIV是否在TD中有效? [英] HTML W3C Valid Elements - Is DIV valid within a TD?

查看:93
本文介绍了HTML W3C有效元素 - DIV是否在TD中有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正和一位同事争论,但找不到证据证明我们是对的。我以前看过给定标签的有效元素列表,但只是无法再找到它。任何人都可以指出我正确的方向吗?



我对XHTML很好奇,但不同意在于DIV标记在HTML 4.01中的TD标记中是否有效。

解决方案

是的。根据HTML 4.01 DTD, td 元素可以包含块级元素和/或内联级元素。



DTD的相关行:

 <!ELEMENT(TH | TD) -  O(%flow;)* - 表格标题单元,表格数据单元 - > 

该行基本上定义了 th td 元素,并声明它们可以包含块和内联元素( * ) >%flow; )。



有关 td 的更多信息: http://www.w3.org/TR/html401/struct/tables。 html#edef-TD


I'm having an argument with a colleague, but can't find the evidence to prove either of us right. I've seen the list of valid elements for given tags before, but just cant find it again. Can anyone point me in the right direction please?

I am curious about XHTML, but the disagreement is specifically over whether a DIV tag is valid within a TD tag in HTML 4.01.

解决方案

Yes. According to the HTML 4.01 DTD, a td element can contain block-level elements and/or inline-level elements.

Relevant line of the DTD:

<!ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data cell-->

This line basically defines the th and td elements, and states that they may contain any combination (*) of block and inline elements (%flow;).

More info on td: http://www.w3.org/TR/html401/struct/tables.html#edef-TD

这篇关于HTML W3C有效元素 - DIV是否在TD中有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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