HTML5標簽與HTML4標簽區(qū)別
(1)概念的變化:
HTML5專注內(nèi)容與結構,而不專注的表現(xiàn)
<header>
<hgroup>導航相關數(shù)據(jù)</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標題:HTML5專題視頻教程</h1>
(2)聲明與標簽:
HTML5在更多的聲明和標簽上面做了簡化,也對兼容做了詳細的規(guī)定,廢除了部分元素,增加了部分元素

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> 標記定義一篇文章 <aside> 標記定義頁面內(nèi)容部分的側邊欄 <audio> 標記定義音頻內(nèi)容 <canvas> 標記定義圖片 <command> 標記定義一個命令按鈕 <datalist> 標記定義一個下拉列表 <details> 標記定義一個元素的詳細內(nèi)容 <dialog> 標記定義一個對話框(會話框) <embed> 標記定義外部的可交互的內(nèi)容或插件 <figure> 標記定義一組媒體內(nèi)容以及它們的標題<footer> 標記定義一個頁面或一個區(qū)域的底部 <header> 標記定義一個頁面或一個區(qū)域的頭部 <hgroup> 標記定義文件中一個區(qū)塊的相關信息 <keygen> 標記定義表單里一個生成的鍵值 <mark> 標記定義有標記的文本 <meter> 標記定義 measurementwithin apredefinedrange <nav> 標記定義導航鏈接 <output> 標記定義一些輸出類型 <progress> 標記定義任務的過程 <rp> 標記是用在Rubyannotations 告訴那些不支持Ruby元素的瀏覽器如何去顯示 <rt> 標記定義對rubyannotations的解釋 <ruby> 標記定義 rubyannotations. <section> 標記定義一個區(qū)域 <source> 標記定義媒體資源 <time> 標記定義一個日期/時間 <video> 標記定義一個視頻 |
HTML5簡單示例
<!DOCTYPE html>
<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>導航相關數(shù)據(jù)</hgroup>
</header>
<nav>菜單</nav>
<article>
<h1>標題:HTML5專題視頻教程</h1>
發(fā)布日期:<time>19:00</time>
<time datetime="2013-2-14">情人節(jié)</time>
<p>測試相關內(nèi)容</p>
</article>
<footer>
<address>地址:xx省xxx市xxx</address>
</footer>
</body>
</html>
本文鏈接:HTML5 標簽語法變化和使用概念,由領悟書生原創(chuàng),轉載請注明出處【http://www.656463.com/article/330】