怎么做pdf电子书下载网站,跨国网站怎么做,豫建设标 网站,自己做的网站发布详细步骤人们在标签使用中最常见到的错误之一就是随意将HTML5的section等价于div——具体地说#xff0c;就是直接用作替代品(用于样式)。在XHTML或者HTML4中#xff0c;我们常看到这样的代码#xff1a; !-- HTML 4-style code --
div idwrapper…人们在标签使用中最常见到的错误之一就是随意将HTML5的section等价于div——具体地说就是直接用作替代品(用于样式)。在XHTML或者HTML4中我们常看到这样的代码 !-- HTML 4-style code --
div idwrapper div idheader h1My super duper page/h1 Header content /div div idmain Page content /div div idsecondary Secondary content /div div idfooter Footer content /div /div 而现在在HTML5中会是这样 !-- 请不要复制这些代码这是错误的 --
section idwrapper header h1My super duper page/h1 !-- Header content -- /header section idmain !-- Page content -- /section section idsecondary !-- Secondary content -- /section footer !-- Footer content -- /footer /section 这样使用并不正确section并不是样式容器。section元素表示的是内容中用来帮助构建文档概要的语义部分。它应该包含一个头部。如果你想找一个用作页面容器的元素(就像HTML或者XHTML的风格)那么考虑如Kroc Camen所说直接把样式写到body元素上吧。如果你仍然需要额外的样式容器还是继续使用div吧。 基于上述思想下面才是正确的使用HTML5和一些ARIA roles特性的例子注意根据你自己的设计你也可能需要加入div body
headerh1My super duper page/h1 !-- Header content -- /header div rolemain !-- Page content -- /div aside rolecomplementary !-- Secondary content -- /aside footer !-- Footer content -- /footer /body 转载于:https://www.cnblogs.com/yeshanshan/p/6958960.html