从HTML5规范中删除了HGROUP元素。可以使用哪种替代技术? [英] HGROUP element removed from the HTML5 Specification. What alternative technique can be used instead?

查看:112
本文介绍了从HTML5规范中删除了HGROUP元素。可以使用哪种替代技术?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你们中的一些人所听到的,<$ href =https://www.w3.org/TR/html5/正在删除 hgroup 元素rel =nofollow> HTML5规范。 (有关详细信息,请参阅 W3C HTML工作组的决定请求在W3C的公共邮件列表存档上从HTML5 中删除 hgroup 。)

As some of you would of heard the hgroup element is being removed from the HTML5 Specification. (For more info, see the W3C HTML Working Group's decision on request to drop hgroup from HTML5 on the W3C's Public Mailing List archives.)

现在我'我目前正在使用这个标签重新设计一个网站,创建一种添加子标题的方法。

Now I'm currently working on the redesign of a site using this tag that creates a way of adding a sub heading.

我目前的想法只是添加另一个 hX 标记,但我不确定这是否足够语义。

My current thoughts are to just add another hX tag under the main header, but I'm not sure if this would be semantic enough to do so.

 <h1>Darren Reay</h1>
 <h2>A developing web developer</h2>
 <p>Hello World</p>

任何人都可以提出使用子标题的替代方案,或者至少指出我正确的方向?

Could anyone either come up with a alternative for using sub headers or at least point me in the right direction?

推荐答案

需要考虑以下几点:


  1. 即使从HTML5规范中删除了标记,也不意味着它会在一夜之间停止工作。浏览器长时间保持向后兼容性(AFAIK大多数(如果不是所有浏览器)仍然正确地呈现< font> !)

即使浏览器会在一夜之间放弃支持,他们仍然会正确呈现页面,因为我认为hgroup标签不会添加任何固有的样式,并且(现代)浏览器在允许不标记的情况下非常宽松认识。

Even if the browsers would drop support overnight, they'd still render the page correctly because I don't think the hgroup tag adds any inherent styling and (modern) browsers are very lenient in allowing tags they don't recognize.

我可能会错误地阅读这个问题,但是在这些行之间听起来好像你一直在滥用hgroup标签。 (除了标题元素之外,不允许包含任何内容。)

I might be reading the question wrong, but between the lines it sounds like you've been misusing the hgroup tag anyway. (It's not allowed to contain anything other than header elements.)

我没有看到任何丢弃问题标签完全或用div替换它们。

I don't see any problem in either dropping the tags completely or replacing them with divs.

这篇关于从HTML5规范中删除了HGROUP元素。可以使用哪种替代技术?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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