Ie 8 does not understand css media queries.

Found a script that solves this problem, only this script is quite voluminous.

Why it is impossible just to check the size of body through js, and, depending on the size, to connect styles?

Why not use this approach?

What are its cons?

  • This is called a crutch, such things are not very welcome, but if you need support for older browsers, then you can also crutch. It works and fine. - AlexOrtizzz
  • I sympathize with you, sadly to observe that some continue to support the old donkey. It is possible to check the size of the visible part through js , nothing terrible. Can you drop the link to this big script? - olegatro
  • IE8? No, I have not heard - korytoff

3 answers 3

The difference in time you spend on debugging. If you make a mistake using CSS, the IDE will show you right away. And in the case of JavaScript, after each edit you need to at least reload the page.

    CSS runs faster, loads the browser less by optimizing ...

      https://github.com/scottjehl/Respond Here is a good solution for old IE