您好,欢迎访问一九零五行业门户网

H5语义标签实际案例

这次给大家带来h5语义标签实际案例,怎么使用h5的语义标签?使用h5的语义标签的注意事项有哪些,下面就是实战案例,一起来看一下。
页面布局是基于html5元素的。所以在开始动手之前先熟悉一下html5元素,然后检查它的语义是否适合你的布局很重要。
the html5 structure
有一点很重要,当编写html5代码的时候,不要简单地把dc6dce4a544fdca2df29d5ac0ea9906b标签用html5中的2f8332c8dcfd5c7dec030a070bf652c3标签代替。有些时候dc6dce4a544fdca2df29d5ac0ea9906b元素在语义
上仍然是一个很不错的选择。比如wrapper或者container div
其中一个新的可以用来替换传统的div元素的标签是1aa9e5d373740b65a0cc8f0a02150c53元素。在1aa9e5d373740b65a0cc8f0a02150c53元素中我们也可以放置用来包裹页面的主要导航菜单
的c787b9a589a3ece771e842a6176cf8e9元素。包含了一个锚点的h1元素是我们blog的标题。
最开始的时候我使用2f8332c8dcfd5c7dec030a070bf652c3来包裹页面的内容,但是在阅读了一些文档之后,感觉这样在语义上并不是100%正确。还是选择了div元素,
在div元素内部,每一篇博客都包裹在它自己的article元素里面。
在一系列博客的下方,有一对分页链接。通常分页链接的重要性并不和c787b9a589a3ece771e842a6176cf8e9(可以被用在多个地方,并不只是主导航)元素
对等。但是本次这个博客布局还是把分页链接作为一个主导航处理。
在15221ee8cba27fc1d7a26c47a001eb9b元素被修订之前,语义上并没有一个专门的元素作为侧边栏。不过,现在可以放心地使用aside元素儿而不用担心语法上的问题。
本示例中aside元素中包含了若干个section元素。在侧边栏的底部有一个简单的搜索框。它可以让我们接触到html5表单的一些新特性。
其中的一个就是placeholder属性
布局最后以footer元素结束。本示例中footer元素需要放置在div容器的外部,这样可以使footer元素的宽度横跨整个页面。
header { margin: 0 0 98px 0; } header h1 { float: left; font-size: 36px; font-weight: normal; } header nav { float: right; text-align: right; padding: 6px 0 0 0; } header nav ul { list-style: none; } header nav li { float: left; font-size: 18px; width: 136px; margin: 0 0 0 20px; } header nav li:nth-child(1):before { content: "1. "; color: #a2a2a2; } header nav li:nth-child(2):before { content: "2. "; color: #a2a2a2; } header nav li:nth-child(3):before { content: "3. "; color: #a2a2a2; } header nav li:nth-child(4):before { content: "4. "; color: #a2a2a2; } header nav li:nth-child(5):before { content: "5. "; color: #a2a2a2; } #sidebar { width: 292px; float: left; padding: 4px 0 0 0; } #sidebar h3 { font-size: 18px; font-weight: normal; margin: 0 0 25px 0; } #sidebar ul { list-style: none; } #sidebar section { margin: 0 0 47px 0; } #sidebar #about a.more { display: block; text-align: right; } #sidebar #categories { width: 136px; float: left; margin: 0 20px 0 0; } #sidebar #social { width: 136px; float: left; } #footer-container { background: rgba(0,0,0,0.2); overflow: hidden; } footer { width: 916px; margin: 0 auto; padding: 10px 22px 50px 22px; } footer #credits { list-style: none; float: left; } footer #credits li { float: left; margin: 0 6px 0 0; } footer #credits li.wordpress a { display: block; width: 20px; height: 20px; background: url(images/credits.png) no-repeat 0 0; text-indent: -9999px; } footer #credits li.spoongraphics a { display: block; width: 25px; height: 20px; background: url(images/credits.png) no-repeat -30px 0; text-indent: -9999px; } footer #back-top { float: right; font-size: 12px; }
相信看了这些案例你已经掌握了方法,更多精彩请关注其它相关文章!
相关阅读:
h5怎么做出拖拽效果
怎样使用h5调用摄像头
关于老版本的浏览器不兼容h5和c3的处理方法
以上就是h5语义标签实际案例的详细内容。
其它类似信息

推荐信息