Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS media query not working in IE 9

I have included some media queries in my design to change the width of some elements of the page based on the browser's width. The queries look like this:

@media screen and (min-width:1024px)
@media screen and (max-width:1024px)

Chrome, Safari and Firefox work great, only IE is a problem. I know that all versions prior to IE 9 don't support this feature, but they don't work in IE 9 at all. What might be the problem?

like image 349
Sacha Avatar asked Aug 02 '11 19:08

Sacha


2 Answers

Do you have compatibility mode turned on?

like image 118
Antony Scott Avatar answered Oct 13 '22 20:10

Antony Scott


Make sure you have right DOCTYPE declaration. It's strongly recommended that websites use the HTML5 document type in order to support the widest variety of established and emerging standards (in this case: CSS3), as well as the broadest range of web browsers: <!DOCTYPE html>

like image 33
Eugene Kardash Avatar answered Oct 13 '22 21:10

Eugene Kardash