桌子TH标签内的H1,H2,H3,H4,H5,H6吗? -HTML [英] H1, H2, H3, H4, H5, H6 inside table TH tags? - HTML

查看:157
本文介绍了桌子TH标签内的H1,H2,H3,H4,H5,H6吗? -HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在table TH标记内使用H1, H2, H3, H4, H5, H6吗? -HTML

Can i use H1, H2, H3, H4, H5, H6 inside the table TH tags? - HTML

我尝试使用w3验证器进行验证,但未验证.我明白了:

I tryed to validate with the w3 validator, but it doesn't validate. I get this:

The element h4 must not appear as a descendant of the th element.
<th><h4>Orange</h4></th>

我使用HTML5,所以我认为最好的主意是使用<div>制作表格,然后将<H4>标记放入其中.还是这也是个坏主意?因为这样看起来像这样:

I use HTML5, so i think that the best idea is to use <div> to make a table and then put the <H4> tags in it. Or is this a bad idea too? Because then it looks something like this:

<h4>first title</h4> <h4>second title</h4> <h4>third title</h4> 
<p>first parahraph</p> <p>second parahraph</p> <p>third parahraph</p>

我不知道它的外观,三个标题标签关闭了,中间没有任何文本或段落.

And i don't know how this looks, 3 heading tags that close, without any text or paragraphs between that.

推荐答案

HTML生活标准明确禁止这样做. th元素内容模型如下(添加了重点):

The HTML living standard explicity forbids this. The th element content model is as follows (emphasis added):

流内容,但具有页眉,页脚,节内容或页眉内容后代.

Flow content, but with no header, footer, sectioning content, or heading content descendants.

"标题内容"是指h1h2等元素以及hgroup元素:

"Heading content" refers to the h1, h2 etc. elements, as well as the hgroup element:

标题内容定义了节的标题(无论是否显式) 使用分段内容元素标记或标题隐含 内容本身.)

Heading content defines the header of a section (whether explicitly marked up using sectioning content elements, or implied by the heading content itself).

h1 h2 h3 h4 h5 h6 hgroup

这篇关于桌子TH标签内的H1,H2,H3,H4,H5,H6吗? -HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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