国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

HTML5 語義化結構化規范化

2024-04-27 14:59:11
字體:
來源:轉載
供稿:網友

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.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黄大仙区| 土默特左旗| 舟山市| 外汇| 深水埗区| 普定县| 莱州市| 平原县| 龙山县| 绥中县| 陇川县| 化德县| 沂水县| 普兰县| 甘肃省| 台东县| 海宁市| 马公市| 建水县| 沙雅县| 丹棱县| 湖南省| 龙游县| 章丘市| 汉中市| 醴陵市| 泽库县| 和顺县| 福建省| 石台县| 潞城市| 泽州县| 体育| 永德县| 白沙| 宜宾市| 历史| 乌兰察布市| 陈巴尔虎旗| 镇雄县| 新蔡县|