首页 > 在IE8及以下浏览器中如何兼容rem?rem.js如何使用?

在IE8及以下浏览器中如何兼容rem?rem.js如何使用?

写css时候使用了css3的rem单位,现在要求兼容ie8,网上查到使用rem.js可以实现兼容ie8,但是我引入后无法实现期望的效果,有没有使用过的同学,这个东西怎么用啊?我只是引入,但是不起作用,求解决


我猜你说的rem.js应该是这个 REM unit polyfill

文档中有一句话

Using rem.js is a cinch; you can load the polyfill conditionally using a loader like yepnope or simply by including a reference to it in your page like so: <script src="js/rem.js" type="text/javascript"></script>. As a best practice, you should either reference rem.js after all of your stylesheets or, better yet, at the end of your <body> tag.

意思是你需要引入rem.js在页脚,也就是css文件,以及dom全部加载完再引入rem.js

ps:下次提问最好把代码,链接,图片一起发上来,还有chrome的调试信息,以及自己做过的尝试

【热门文章】
【热门文章】