html 5 添加了一些新元素,用來標(biāo)識常用的結(jié)構(gòu),是html更具語義化,可是我們無法直接使用,即使可能用到還要等他個十年八年的。 那就像微格式一樣,使用class代替,或者隨意點,使用id和class名來代替,讓自己的結(jié)構(gòu)更加清晰化,可以推廣為規(guī)范,讓團隊協(xié)作更加順暢。
一些新增的結(jié)構(gòu)標(biāo)記
◎ section:這可以是書中的一章或一節(jié),實際上可以是在 html 4 中有自己的標(biāo)題的任何東西 ◎ header:頁面上顯示的頁眉;與 head 元素不一樣 ◎ footer:頁腳;可以顯示電子郵件中的簽名 ◎ nav:指向其他頁面的一組鏈接 ◎ article:blog、雜志、文章匯編等中的一篇文章
<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的圖片結(jié)構(gòu)
<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的加上標(biāo)記
m 元素表示文本被 “加上標(biāo)志”,但是不一定要強調(diào)。可以把它想像成書中突出顯示的一節(jié)。 google 的緩存頁面就是典型的用例。如果鏈接到一個緩存的副本,搜索詞就被加上標(biāo)志。例如,如果搜索 “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的加上標(biāo)記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.