HTML5標簽與HTML4標簽區別
(1)概念的變化:
HTML5專注內容與結構,而不專注的表現
<hgroup>導航相關數據</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標題:HTML5專題視頻教程</h1>
(2)聲明與標簽:
HTML5在更多的聲明和標簽上面做了簡化,也對兼容做了詳細的規定,廢除了部分元素,增加了部分元素
HTML5標簽語法介紹及新增標記
1、語法標簽:
(1) 不允許寫的結束符的標簽:area、basebr、col、command、Embed、hr、img、input、keygen、link、meta、param、source、Track、wbr (2)可以省略結束符的標簽:li、dt、dd、p、rt、optgroup、option、Colgroup、thread、tbody、tr、td、th (3)可以完全省略的標簽:html、head、body、colgroup、tbody |
2、新增標簽:
<article> 標記定義一篇文章 |
HTML5簡單示例
<head>
<meta charset=utf-8>
<title>頁面結構</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>導航相關數據</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標題:HTML5專題視頻教程</h1>
發布日期:<time>19:00</time>
<time datetime="2013-2-14">情人節</time>
<p>測試相關內容</p>
</article>
<footer>
<address>地址:xx省xxx市xxx</address>
</footer>
</body>
</html>
本文鏈接:HTML5 標簽語法變化和使用概念,由領悟書生原創,轉載請注明出處【http://www.656463.com/article/330】