HTML5標(biāo)簽與HTML4標(biāo)簽區(qū)別
(1)概念的變化:
HTML5專注內(nèi)容與結(jié)構(gòu),而不專注的表現(xiàn)
<hgroup>導(dǎo)航相關(guān)數(shù)據(jù)</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標(biāo)題:HTML5專題視頻教程</h1>
(2)聲明與標(biāo)簽:
HTML5在更多的聲明和標(biāo)簽上面做了簡化,也對兼容做了詳細(xì)的規(guī)定,廢除了部分元素,增加了部分元素
HTML5標(biāo)簽語法介紹及新增標(biāo)記
1、語法標(biāo)簽:
(1) 不允許寫的結(jié)束符的標(biāo)簽:area、basebr、col、command、Embed、hr、img、input、keygen、link、meta、param、source、Track、wbr (2)可以省略結(jié)束符的標(biāo)簽:li、dt、dd、p、rt、optgroup、option、Colgroup、thread、tbody、tr、td、th (3)可以完全省略的標(biāo)簽:html、head、body、colgroup、tbody |
2、新增標(biāo)簽:
<article> 標(biāo)記定義一篇文章 |
HTML5簡單示例
<head>
<meta charset=utf-8>
<title>頁面結(jié)構(gòu)</title>
<style type="text/css">
header,nav,article,footer {border:solid 1px #666;padding:5px}
header{width:500px}
nav{float:left;width:60px;height:300px}
article{float:left;width:428px;height:300px}
footer{clear:both;width:500px}
</style>
<script type="text/javascript">
document.createElement('article');
document.createElement('nav');
document.createElement('header');
</script>
</head>
<body>
<header>
<hgroup>導(dǎo)航相關(guān)數(shù)據(jù)</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標(biāo)題:HTML5專題視頻教程</h1>
發(fā)布日期:<time>19:00</time>
<time datetime="2013-2-14">情人節(jié)</time>
<p>測試相關(guān)內(nèi)容</p>
</article>
<footer>
<address>地址:xx省xxx市xxx</address>
</footer>
</body>
</html>
本文鏈接:HTML5 標(biāo)簽語法變化和使用概念,由領(lǐng)悟書生原創(chuàng),轉(zhuǎn)載請注明出處【http://www.656463.com/article/330】