国产探花免费观看_亚洲丰满少妇自慰呻吟_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.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凤庆县| 宁陕县| 故城县| 六安市| 江门市| 长阳| 江口县| 花莲县| 曲麻莱县| 嘉黎县| 抚顺县| 景泰县| 安乡县| 新龙县| 惠来县| 芷江| 清远市| 武鸣县| 香河县| 行唐县| 稻城县| 伊吾县| 麻城市| 定州市| 长沙市| 石柱| 杭州市| 社旗县| 华容县| 张家界市| 仲巴县| 祁阳县| 静安区| 拉萨市| 斗六市| 冷水江市| 乌兰浩特市| 上栗县| 博白县| 西和县| 宜丰县|