HTML5 可以让很多更语义化的结构化代码标签代替大量的无意义的 div 标签。这种语义化的特性不仅提升了网页的质量和语义,并且减少了以前用于CSS 调用的class 和 id 属性。
html5常用结构标签: header,nav,body,article,section,aside,hgroup,figure,figcaption,footer
标签定义外部的内容,可以是一篇新的文章。
标签定义 article 以外的内容,aside 的内容可用作文章的侧边栏。
标签定义 figure 元素的标题。
标签用于对元素进行组合,使用 figcaption 元素为元素组添加标题。
标签定义 section 或 文档 的页脚。
标签定义 文档 的页眉。
标签用于对 section 或 网页 的标题进行组合,使用 figcaption 元素为元素组添加标题。
标签定义 导航链接 的部分。
标签定义文档中的节( section、区段 )。比如章节、页眉、页脚或文档中的其他部分。
标签定义日期或时间,或者两者。
html5结构标签让页面布局更语义化 body,div{margin:0px;padding:0px;}.clear:after{ visibility:hidden; display:block;font-size:0; content:"."; clear:both;height:0;} * html .clear{zoom:1;clear:both;}*:first-child+html .clear{zoom:1;clear:both;} .clear{ zoom:1; clear:both;}header{border:1px solid green;margin:5px auto;width:80%;height:100px;background:#abcdef;}header nav{border:1px solid black;height:100px;line-height:100px;text-align:center;font-size:30px;color:green;}.container{border:1px solid green;width:80%;height:auto;margin:5px auto;background:#abcdef;}.container section{width:65%;border:1px solid black;height:450px;text-align:center;font-size:30px;color:green;line-height:450px;float:left;background:#abcdef;}.container aside{width:32%;border:1px solid black;height:450px;line-height:450px;text-align:center;font-size:30px;color:green;float:right;background:#abcdef;}footer{border:1px solid green;width:80%;height:100px;line-height:100px;text-align:center;font-size:30px;color:green;margin:5px auto;background:#abcdef;} headersection aside
查看更多关于html5语义化标签_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did110218