Home >Web Front-end >CSS Tutorial >How Can I Implement CSS Media Queries in IE8?
IE8 and CSS Media Queries: Troubleshooting and Alternatives
Question:
IE8 appears to lack support for the following media query:
@import url("desktop.css") screen and (min-width: 768px);
If this is true, what alternative syntax can be used?
Answer:
IE8 indeed does not support CSS media queries. As a workaround, you can use the following code:
@import url("desktop.css") screen; @import url("ipad.css") only screen and (device-width:768px);
However, this solution has its limitations. It does not support all media query features available in modern browsers.
Alternative Solution:
For a more complete solution that emulates media queries in IE8, consider using the css3-mediaqueries-js script. This script emulates media queries, but it has some constraints: