I developed a site using twitter bootstrap and it seems that the responsive layout part is broken in all IE browsers from IE8 and below. Is this just not supported for these browsers?
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- How to add a “active” class to a carousel first el
- Add animation to jQuery function Interval
- jQuery hover to slide?
You should all read this forum post.It explains very clearly the challenges between IE and Twitter Bootstrap. It also gives you solutions that actually work.
Quote:
For supporting
@media
queries in IE 8 and below, check outcss3-mediaqueries-js.
css3-mediaqueries.js by Wouter van der Graaf is a JavaScript library to make IE 5+, Firefox 1+ and Safari 2 transparently parse, test and apply CSS3 Media Queries. Firefox 3.5+, Opera 7+, Safari 3+ and Chrome already offer native support.
PS: I use Twitter Bootstrap with this plugin and it works awesome! Hope this helps! :)
These are the steps I took to get this working:
Take a look at the response.js demo page in IE8:
https://rawgithub.com/scottjehl/Respond/master/test/test.html
It works so get that working locally by downloading the response.js into your vendor/assets or somewhere similar.
Disable your local bootstrap and try this in your css:
It works!
Because I was using the cdn, I needed to download and host it locally:
http://getbootstrap.com/getting-started/#download
So, it works with these:
You'll also need to get rid of any @import declarations.
I used the html5shiv at:
https://code.google.com/p/html5shiv/
This worked for me. It is also available using bower.
If you want to have better performance and your structure is not too complicated.
You can try Respond.JS
From the author:
I have tried all of the ways described above, and it works but so slowly. I offer the next approach. We should decompose css file that is contains @media and insert each rule in the separate file. Then we should conditionally upload each file, depending from browser screen width. All this actions will do the script cload.js. Download cload.js and read how to use it you can here