ad


CSS中文手册加入收藏设为首页共享模板提交创意简繁转换

您现在的位置: :首页 > 网页设计 > html语言 > >> 正文

HTML5 语义化结构化规范化

『 更新时间:2008-04-28 05:53:08 』『 字体: 』『 编辑:归来 |  来源: 』

HTML结构更加清晰、规范,学习HTML5优化结构的思路。

HTML 5 添加了一些新元素,用来标识常用的结构,是html更具语义化,可是我们无法直接使用,即使可能用到还要等他个十年八年的。
那就像微格式一样,使用class代替,或者随意点,使用id和class名来代替,让自己的结构更加清晰化,可以推广为规范,让团队协作更加顺畅。

一些新增的结构标记

◎ section:这可以是书中的一章或一节,实际上可以是在 HTML 4 中有自己的标题的任何东西
◎ header:页面上显示的页眉;与 head 元素不一样
◎ footer:页脚;可以显示电子邮件中的签名
◎ nav:指向其他页面的一组链接
◎ article:blog、杂志、文章汇编等中的一篇文章

一些例子

HTML5的文档结构
<header>...</header>
<nav>...</nav>
<article>
<section> ... </section>
</article>
<aside>...</aside>
<footer>...</footer>
XHTML的文档结构

<div id="header">header</div>
<div id="nav">nav</div>
<div class="article">
<div class="section">section</div>
</div>
<div id="aside">aside</div>
<div id="footer">footer</div>
HTML5的图片结构

<figure id="fig2">
<legend>Figure 2. Install Mozilla XForms dialog</legend>
<img alt="A Web site is requesting permission to install the ollowing item: Mozilla XForms 0.7 Unsigned" src="installdialog.jpg" />
</figure>
XHTML的图片结构 网页教学网

<div class="figure">
<h4 class="legend">Figure 2. Install Mozilla XForms dialog</h4>
<img alt="A Web site is requesting permission to install the ollowing item: Mozilla XForms 0.7 Unsigned" src="installdialog.jpg" />
</div>
HTML5的加上标记

  m 元素表示文本被 “加上标志”,但是不一定要强调。可以把它想像成书中突出显示的一节。
  Google 的缓存页面就是典型的用例。如果链接到一个缓存的副本,搜索词就被加上标志。例如,如果搜索 “Egret”,那么缓存的 Google 页面可能像下面这样:

The Great <m>Egret</m> (also known as the American <m>Egret</m>) is a large white wading bird found worldwide.The Great <m>Egret</m> flies with slow wing beats. The scientific name of the Great <m>Egret</m> isCasmerodius albus.XHTML的加上标记The Great <span class="m">Egret</span> (also known as the American <span class="m">Egret</span>) is a large white wading bird found worldwide.The Great <span class="m">Egret</span> flies with slow wing beats. The scientific name of the Great <span class="m">Egret</span> isCasmerodius albus.

共有 位网友发表了评论 收藏该内容报告错误点击复制信息给好友分享查看所有网友评论关闭此页面
  • 您暂未登陆,请登陆后发表! 或直接填写昵称匿名发表
  • 1.请勿发表广告及不良言论.
  • 2.本文内容及版权归原作者.
  • 匿名?
关于我们 | 投稿指南 | 广告服务 | 建站服务 | 联系我们 | 网站地图 | 友情连接 | 诚征英才
欢迎您光临模板CMS,竭尽全力为您打造最专业的CMS资源站点!联系我26211803 联系我667559
建站交流群:1700154 模板交流群:37797574 49415971 10086677 交流论坛
Copyright © 2005-2007 www.mobancms.com online services. All rights reserved. Template designed by lacdy.
模板CMS版权所有 豫ICP备06002344号