Home >Web Front-end >CSS Tutorial >Does IE8 Support Modern CSS Media Queries?
Question: Does IE8 not support the following CSS media query?
@import url("desktop.css") screen and (min-width: 768px);
Answer: IE8 does not support the given media query. An alternative way of writing it that is compatible with IE8 is:
@import url("desktop.css") screen; @import url("ipad.css") only screen and (device-width:768px);
Note: This updated code uses nested @import statements. However, @import can impact performance and is not recommended for production use. Consider using a media query polyfill instead.
CSS3 Media Queries Polyfills:
To support media queries in IE8 and older browsers, you can use JavaScript polyfills like:
The above is the detailed content of Does IE8 Support Modern CSS Media Queries?. For more information, please follow other related articles on the PHP Chinese website!