section标签「section标签的属性」
section标签正则表达识别不出来
Section标签正则表达式应该是section\s*[^]*(.*?)\/section,识别通常不会出错,只有某些特殊的HTML文档结构会对其造成影响。
section是Html5新增的标记吗?
section 标签定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分。
section是html5的新标签

所有浏览器都支持 section 标签。
div,section,article的区别和使用
div:本身没有任何语义,用作布局以及样式化。
section:与 div 的无语义相对,简单地说 section 就是带有语义的 div 了,但是千万不要觉得真得这么简单。section 表示一段专题性的内容,一般会带有标题。section 应用的典型场景有文章的章节、标签对话框中的标签页、或者论文中有编号的部分。一个网站的主页可以分成简介、新闻和联系信息等几部分。section 不仅仅是一个普通的容器标签。当一个标签只是为了样式化或者方便脚本使用时,应该使用 div 。一般来说,当元素内容明确地出现在文档大纲中时,section 就是适用的。
article
hgroup
h1Apples/h1
h2Tasty, delicious fruit!/h2
/hgroup
pThe apple is the pomaceous fruit of the apple tree./p
section
h1Red Delicious/h1
pThese bright red apples are the most common found in many
supermarkets./p
/section
section
h1Granny Smith/h1
pThese juicy, green apples make a great filling for
apple pies./p
/section
/article
article:这是一个特殊的 section 标签,它比 section 具有更明确的语义, 它代表一个独立的、完整的相关内容块。一般来说,
article 会有标题部分(通常包含在 header 内),有时也会 包含 footer 。虽然 section
也是带有主题性的一块内容,但是无论从结构上还是内容上来说,article 本身就是独立的、完整的。当 article 内嵌 article 时,原则上来说,内部的 article 的内容是和外层的 article 内容是相关的。例如,一篇博客文章中,包含用户提交的评论的 article 就应该潜逃在包含博客文章 article 之中。
article
header
h1The Very First Rule of Life/h1
ptime pubdate datetime="2009-10-09T14:28-08:00"/time/p
/header
pIf there's a microphone anywhere near you, assume it's hot and
sending whatever you're saying to the world. Seriously./p
p.../p
section
h1Comments/h1
article
footer
pPosted by: George Washington/p
ptime pubdate datetime="2009-10-10T19:10-08:00"/time/p
/footer
pYeah! Especially when talking about your lobbyist friends!/p
/article
article
footer
pPosted by: George Hammond/p
ptime pubdate datetime="2009-10-10T19:15-08:00"/time/p
/footer
pHey, you have the same first name as me./p
/article
/section
/article
总结:div section article ,语义是从无到有,逐渐增强的。div
无任何语义,仅仅用作样式化,对于一段主题性的内容,则就适用
section,而假如这段内容可以脱离上下文,作为完整的独立存在的一段内容,则就适用 article。原则上来说,能使用 article
的时候,也是可以使用 section 的,但是实际上,假如使用 article 更合适,那么就不要使用 section 。nav 和 aside
的使用也是如此,这两个标签也是特殊的 section,在使用 nav 和 aside 更合适的情况下,也不要使用 section 了。
对于 div 和 section、 article 以及其他标签的区分比较简单。对于 section 和 article
的区分乍看比较难,其实重点就是看看这段内容脱离了整体是不是还能作为一个完整的、独立的内容而存在,这里面的重点又在完整身上。因为其实说起来
section 包含的内容也能算作独立的一块,但是它只能算是组成整体的一部分,article 才是一个完整的整体。
section标签是节标签吗
section标签定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分,section元素表示文档或应用的一个部分。所谓“部分”,这里是指按照主题分组的内容区域,通常会带有标题。
注意:
section 不是一个专用来做容器的标签,如果仅仅是用于设置样式或脚本处理,专用的是 div
section 里应该有 标题(h1~6),但文章中推荐用 article 来代替
一条简单的准则是,只有元素内容会被列在文档大纲中时,才适合用section元素。
section的作用是对页面上的内容进行分块,如各个有标题的版块、功能区或对文章进行分段,不要与有自己完整、独立内容的article混淆。