Avatar of Al4ddin2
Al4ddin2 asked on

Building responsive website in IE8

I know that media queries are not supported in IE and below, so I am keen to understand how <IE9 browsers treat them? Do they just ignore any styling withing a media query and use the base styles? My aim is to build mobile up so does that mean that IE8 would use the mobile style?

Also what are my options for getting around this? I have read a little on respond.js or is it better to use a specific IE CSS instead or like the 320 and up framework it appends a class to the html tag when being viewed in <IE9 so that over-writing styles can be used but this will bloat the CSS will it not?

Any advice would be great.

Thanks
HTMLCSSjQuery

Avatar of undefined
Last Comment
Rob

8/22/2022 - Mon
Julian Hansen

Also what are my options for getting around this?
Don't support IE8 - seriously - unless your client is chained to it don't support it.

There is no reason IE8 should continue to go on living - it is a thorn in the side of web dev and needs to go the way of IE6.

Rather spend your time on HTML5 and build a great 21st centuary site.
Rob

+1 for what JulianH has said... Don't support it if you don't need to.

I would like to know WHY you want to support IE8.  Where did this come from?
ASKER
Al4ddin2

Stats. We still have enough users on IE8 to warrant the people above wanting to support it. Plus a lot of people at the company use it.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Rob

Fair comment so sounds like your hands are tied for the moment.

As for the media queries, they are just ignored by < IE9.  The accepted way around this is to use IE's conditional commenting:

<link rel="stylsheet" type="text/css" media="all" href="style.css"/>
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" media="all" href="style-ie.css"/>
<![endif]-->

Open in new window

Julian Hansen

[NFP - not for points]
Just to clarify
unless your client is chained to it don't support it.
Seems like you are in the unfortunate position of having to develop for it.

Tagit has you on the right track but consider mentioning to your client that supporting IE8 is expensive in terms of time and they should consider upgrading.
ASKER
Al4ddin2

What about respond.js?

Surely that would be easier that maintaining two stylesheets? no?

Thanks
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
COBOLdinosaur

Just because you have to support IE8 does not mean you have to support it on devices IT DOES NOT SUPPORT.

Do an IE8 stylesheet and leave it at that any effort to enhance the IE8 experience on non-supported devices is going to be as productive as using a tennis racket with no strings.

Cd&
ASKER CERTIFIED SOLUTION
Rob

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question