ie8及其如下版本兼容性問題之響應式

解決辦法:引入Respond.js讓IE6-8支持CSS3 Media Querycss

使用方式html

參考官方demo:http://scottjehl.github.com/Respond/test/test.htmlgit

1.在css中正經常使用 min/max-width media queriesgithub

@media screen and (min-width: 480px){
     ...styles for 480px and up go here
 }

2.引入respond.min.js,但要在css的後面(越早引入越好,在ie下面看到頁面閃屏的機率就越低,由於最初css會先渲染出來,若是respond.js加載得很後面,這時從新根據media query解析出來的css會再改變一次頁面的佈局等,因此看起來有閃屏的現象)佈局

參考連接:Respond.js讓IE6-8支持CSS3 Media Querycode

下載地址:https://github.com/scottjehl/Respondhtm

相關文章
相關標籤/搜索