HTML5標籤與HTML4標籤的區別樣本介紹_html5教程技巧

來源:互聯網
上載者:User

標籤:style   class   code   java   http   ext   

(1)概念的變化: 

HTML5專註內容與結構,而不專註的表現 

<header> 
<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> 標記定義一篇文章 
<aside> 標記定義頁面內容部分的側邊欄 
<audio> 標記定義音頻內容 
<canvas> 標記定義圖片 
<command> 標記定義一個命令按鈕 
<datalist> 標記定義一個下拉式清單 
<details> 標記定義一個元素的詳細內容 
<dialog> 標記定義一個對話方塊(會話框) 
<embed> 標記定義外部的可互動的內容或外掛程式 
<figure> 標記定義一組媒體內容以及它們的標題<footer> 標記定義一個頁面或一個地區的底部 
<header> 標記定義一個頁面或一個地區的頭部 
<hgroup> 標記定義檔案中一個區塊的相關資訊 
<keygen> 標記定義表單裡一個產生的索引值 
<mark> 標記定義有標記的文本 
<meter> 標記定義 measurementwithin apredefinedrange 
<nav> 標記定義導航連結 
<output> 標記定義一些輸出類型 
<progress> 標記定義任務的過程 
<rp> 標記是用在Rubyannotations 告訴那些不支援Ruby元素的瀏覽器如何去顯示 
<rt> 標記定義對rubyannotations的解釋 
<ruby> 標記定義 rubyannotations. 
<section> 標記定義一個地區 
<source> 標記定義媒體資源 
<time> 標記定義一個日期/時間 
<video> 標記定義一個視頻 

HTML5簡單樣本

  1. <!DOCTYPE html> 
  2. <head> 
  3. <meta charset=utf-8> 
  4. <title>PHP100中文網HTML5專題</title> 
  5. <style type="text/css" rel="stylesheet"> 
  6. header,nav,article,footer {border:solid 1px #666;padding:5px} 
  7. header{width:500px} 
  8. nav{float:left;width:60px;height:200px} 
  9. article{float:left;width:428px;height:200px} 
  10. footer{clear:both;width:500px} 
  11. </style> 
  12. <script type="text/javascript"> 
  13. document.createElement(‘article‘); 
  14. document.createElement(‘nav‘); 
  15. document.createElement(‘header‘); 
  16. </script> 
  17. </head> 
  18. <body> 
  19. <header> 
  20. <hgroup>導航相關資料</hgroup> 
  21. </header> 
  22. <nav>菜單</nav> 
  23. <article> 
  24. <h1>HTML5專題視頻教程</h1> 
  25. 發布日期:<time>09:00</time> 
  26. <time datetime="2013-2-10">春節</time> 
  27. <p>測試相關內容</p> 
  28. </article> 
  29. <footer> 
  30. <address>地址</address> 
  31. </footer> 
  32. </body> 
  33. </html>
複製代碼 詳細說明:http://html5.662p.com/thread-19-1-1.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.