html5有哪些新特性?如何處理html5新標籤的瀏覽器兼容問題?如何區分html和html5?

h5新特性:
  語義化標籤:<hrader></header> 、<footer></footer>、<nav></nav>、<section></section>、<article></article>、<aside></aside>、<video></video>、<audio></audio>
  新增表單元素:email、month、number、range、search、tel、url、week、time、date、datatime、datetime-local
  新增表單屬性:placeholder、required、autofocus、autocomplete、maxlength、novalidate、max、min、step、multipe、disabled、checked
  新增的視頻和音頻標籤:<video></video>、<audio></audio>
  canvas繪圖
  SVG繪圖
  拖拽
  WebWorker、WebStorage、WebSockethtml


h5新標籤的兼容問題:
  (1)IE8/IE7/IE6支持經過 document.createElementhtml5

  (2)將html5shiv.js引入到head中(IE9及如下)
    <!--[if lt IE9]><script src="dist/html5shiv.js"></script><![endif]-->canvas

    載入後,初始化新標籤的CSS:ide

    /*html5*/ article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}ui

 

如何區分html和html5:
  (1)在文檔類型聲明上,h5爲<!DOCTYPE html>,以前版本比較長
  (2)h5有語義化標籤,如<header></header>url

相關文章
相關標籤/搜索