是否有必要标题为< section>在HTML5中 [英] Is it necessary to have a heading of <section> in HTML5

查看:150
本文介绍了是否有必要标题为< section>在HTML5中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有必要在HTML5中标题< section> ,如此处所述 http://blog.whatwg.org/is-not-just-a-semantic

Is it necessary to have a heading of <section> in HTML5 like mentioned here http://blog.whatwg.org/is-not-just-a-semantic

在页面上的某个时间,我们有一些相关的元素,可以组合成< section id =semantic name> 而不是 < div id =语义名称> 但我们没有任何标题..

Sometime on a page we have some elements which are related and can be combined in a <section id="semantic name"> instead <div id="semantic name"> But we don't have any Heading for that..

是否可以使用< section> 没有< h1> < h2> < h3> 里面

Is it OK to use <section> without having <h1>, <h2>, <h3> inside

推荐答案

根据HTML5医生,你不应该使用< section> 如果没有自然标题。此外,他们说:

According to the HTML5 Doctor, you should not use <section> if there is no natural heading for it. Also, they say:


section元素表示通用文档或应用程序部分... section元素不是通用容器元素。当一个元素需要用于样式目的或作为脚本的便利时,鼓励作者使用div元素。

The section element represents a generic document or application section…The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead.

此外, 查看这个漂亮的流程图,以确定最适合使用的元素在你的情况下。

Also, check out this nifty flowchart to decide what element is best to use in your situations.

这篇关于是否有必要标题为&lt; section&gt;在HTML5中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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