IE7 and IE8 support for CSS3 Media Query

By , April 1st, 2013 , Tags: , , , , 19 Comments

Normally IE5 to IE8 do not support CSS3 Media Query. But at least IE8 should support for CSS3 Media Query and that is very important for cross-browser responsive web design. Here I will tell you how you can solve the CSS3 Media Query issues for IE. This tutorial will helps you to create a dynamic resolution dependent layout with web standards in mind.

Today I got a great jQuery plugin [Link] name css3-mediaqueries. It is very easy to use.

How to use?

Download jQuery plugin form Here and include downloaded script just before </body> like

Or you can use following way to include the script.

Then write the media query in style sheet and check it in IE. It will work nicely with IE8, IE7 Even more older version IE6 or IE5


It doesn’t work on @import’ed stylesheets

Write media query with following way

Use keyword ‘and’ in query (‘or’ is not supported)

  • Giorgio

    Zero comments??? No way, fellow! Although IE8 is finally dying, I still have a considerable percentage of visitors using it (don’t know why…). Anyway: extremely useful tool, thank you very much!!!

  • TheSeeker2013 .

    I have inserted the “” tag inside the tag linked to the script file accordingly, I have also tried the other way “” and neither worked. I moved the script tag before or after the other CSS referenced link tags and still won’t work for IE7 or 8.

    IE9 works fine because it accepts @media queries, but this script won’t work for IE7 or 8.

    Any ideas or suggestions?

    • MoneyGrabSequel

      Read all of the instructions! It clearly states “It doesn’t work on @import’ed stylesheets” and you clearly are using external/imported CSS because you posted…”I moved the script tag before or after the other CSS referenced link tags…”

      The CSS has to be embedded for this to work, but it does work.

      • TheSeeker2013 .

        If you read clearly, it said “@imported”, which refers to media
        queries. Since I am not a mind reader, I take that literally because of
        the syntax and that means it refers to only @media query sheets. I
        believe it was a bad (& lazy) use of syntax on his part if he wanted
        to refer to all external style sheets. Simply say, “all external style

        Now since the CSS has to be inline (embedded), then this method is
        essentially useless when dealing with a large number of webpages. The
        amount of time to change a large number of webpages just because the CSS
        has to be inline for this jquery method to work. This method maybe
        useable only on small sites with limited pages, but still, inline CSS is
        suppose to be limited to only a need basis, this is the way
        professional web designers are taught. Thus the jquery method defeats
        this standard and forces the web designer to place the majority or all
        CSS inline.

        Overall, it is therefore useless.

  • rowilsonh

    si funciono, gracias, genial.
    awesome… thanks..

  • sushil

    Wrong information…. its not working in ie8 and ie7

    • Bora

      works like a charm, i guess you did something wrong

    • Oupier

      it works very well.
      One thing must be noted is that the “screen” is necessary:

      @media (min-width: 481px) { /* … */ } will not work, it must be
      @media screen and (min-width: 481px) { /* … */ }

      • Dragan Filipović

        With ”screen” it works also in external css.
        Tested in IE8.

    • MoneyGrabSequel

      tested works fine in IE7 (I’m assuming it’ll work in IE8 too)

      The important detail people miss is that it “It doesn’t work on @import’ed stylesheets” — with embedded CSS works fine. But I’m looking for another solution as I need media quires to work with external CSS…any ideas?

  • gangesh00

    Thanks! works well.

  • sudhakar

    Thank you very much.

  • Alex

    I dont know how should i make it work!
    One of my css line: @media only screen and (min-width:820px){#maintitle .page{width:auto;}}

    What should i rewrite here?
    I dont get it

  • mr. right

    this’s super awful web…if you know’d run this web on ie8…

  • EmmyBN

    Hi guys! Thanks for posting this! Unfortunately the downloadable files are not in the link provided any more. Could someone please send it somehow?


  • MortisDux

    Really very very nice!! Thanks a lot you resolved a ie issue that I’ve been working on for 2 days!! Trying to reproduce the collapsed navbar menu from bootstrap but it was not working and now it is! Thanks !!

  • @NetDeveloper

    thank u so much.

  • Weck

    It seems that the plugin is not available anymore on the website.. is it ?

  • pooja

    how to solve the droup down issue
    in IE browser ..plz tell me

I founded CSS Matter in 2013 with the sole ambition of design, development, creativity and innovation on the Internet, which recognize and promote the best web designers, developers and web users in the world. I'm skilled, talented, creative and very passionate about my work. I like to work closely with people to ensure that each stage of a project goes great every step of the way. I like to ensure that all of my finished projects/work reflect how highly I would like to be perceived. I'm confident that with your ideas and my expertise we can create something that makes us both smile. If you like what I do, and think we could work together then don't hesitate to get in touch with me. Skype IM : cssmatter And Email

Want to write for CSS Matter?

If you're interested in becoming part of the CSS Matter team of authors, please send an email to Manish Salunke. It's best if you already have article ideas in mind – but if you don't, he'll help you find a good topic to cover.

Get Updates On Twitter

Do you want to get real-time updates, interesting web links, site news and announcements via Twitter? Follow CSS Matter on Twitter.

Subscribe to the RSS feed Today

The best way to keep up with CSS Matter articles regularly is by putting the CSS Matter RSS feed into your feed reader.