• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

Working around IE8 for mobile responsive website in DNN (.net, vb, .aspx)

Hi, I'm developing websites using the DNN (DotNetNuke) Content management system (.net, .vb, .aspx pages). I've implemented a mobile friendly strategy by using media queries in the css, but of course IE8 and other old browsers don't support media queries and it breaks the site in those browsers.

I would like to find a way to serve different .css when IE8 (or other old browsers) are used. How can I do that inside my skin files (.ascx vb)?

Any help is appreciated!!

Thanks

Tom
0
tommelkonian
Asked:
tommelkonian
1 Solution
 
Bob LearnedCommented:
One possibility is CSS3 Media Queries

https://code.google.com/p/css3-mediaqueries-js/

Another is Respond.js:

https://github.com/scottjehl/Respond
0
 
David S.Commented:
JavaScript can be used but that seems like a lot of unnecessary overhead to me, so I use a conditional comment to load the large screen stylesheet (e.g. desktop) in IE 8 and older:

<link rel="stylesheet" href="css/mobile.css" media="all">
<link rel="stylesheet" href="css/desktop.css" media="all and (min-width: 720px)">
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" href="css/desktop.css" media="all">
<![endif]-->

Open in new window

The trick then becomes remembering to keep styles outside of media query blocks which you want those old IE versions to use. Sometimes I'll have a style inside a media query block in the mobile stylesheet and then add it to the desktop stylesheet as well, outside of any media query blocks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now