ie8下面版本號碼(包含ie8)的瀏覽器不支援html5標籤屬性解決方式(Modernizr 2.6.2外掛程式的使用)

來源:互聯網
上載者:User

標籤:blog   group   tee   pre   span   瀏覽器   6.2   朋友   ref   

我這邊申明下:我寫這篇日誌主要是想然ie8可以支援html5的個別標籤閉合,並不能讓ie全然支援html5。我之前寫的可能會誤導非常多同學。希望大家能明確。



今天腦抽想用html5標籤設計一個網頁。我本人用的是Firefox瀏覽器,都弄好後我發現一個非常嚴重的問題。除了ie9下面的瀏覽器都不能支援html5標籤(article,aside,dialog,footer,header,section,footer,nav,figure,menu)。

我上網找了好多中方法。有網友說使用

<!--[if lt IE9]><script>   (function() {     if (!     /*@[email protected]*/     0) return;     var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', ');     var i= e.length;     while (i--){         document.createElement(e[i])     }})()</script><![endif]-->

或者

<!--[if lt IE9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> //Google如今已經退出了中國市場(除了中國和朝鮮以外的國家都能夠訪問,呵呵~)<![endif]-->/*html5*/article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}

我都試過了。可是發現還是不行,我就非常納悶。於是我就“靈機一動”找了幾個國外的網站解剖它發現原來是使用了 Modernizr外掛程式,我就死馬當活馬醫放到了網頁中。結果不出我所料果然全部的html5標籤都能夠支援。我用ie11的開發人員模式調試了ie6-ie8都沒有問題,甚至無聊的我還測試了ie5也能夠完美支援。

事實上這個Modernizr外掛程式的功能非常強大還不止這些假設想要瞭解很多其它的資料能夠點擊官網查看

這是一遍中文的簡單介紹挺好的能夠看看哦~說了這麼多,還是把外掛程式拿出來分享,狠狠點擊這裡下載,直接在head那邊加入

<script src="http://haiqiancun.com/file/demo/custom.modernizr.js"></script>

這個外鏈外掛程式指令碼讓你的頁面不在煩惱。


這個是我的qq:419268793。歡迎志同道合的朋友。


原文地址http://haiqiancun.com/bbs/bbsPage/0/detail/297e9e7946a599780146a5a38dde0003/1/20140812090617


ie8下面版本號碼(包含ie8)的瀏覽器不支援html5標籤屬性解決方式(Modernizr 2.6.2外掛程式的使用)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.