Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5850501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:08:58+00:00 2026-05-22T13:08:58+00:00

I have a bunch of CSS written that makes my site target Mobile first,

  • 0

I have a bunch of CSS written that makes my site target Mobile first, then I use CSS Media Queries to load another stylesheet for desktop browsers. I do this since there are so many mobile browsers that don’t understand CSS Media Queries, and it’s more likely that desktop users have modern browsers that support this.

I have the following CSS that works in all modern browsers (IE9, Chrome, Firefox 3.6+, Safari 4+5):

I then realized that IE7 and IE8 don’t support CSS Media Queries so the above wouldn’t work. So I added a conditional statement to load it:

<link rel="Stylesheet" type="text/css" href="/css/mobile.css" media="all"/>
<!-- [if lt IE 9]>
<link rel="Stylesheet" type="text/css" href="/css/desktop.css" media="all" />
<! [endif] -->  
<link rel="Stylesheet" type="text/css" href="/css/desktop.css" media="only screen and (min-width: 640px)" />

However, using IE Tester and Browsershots, I’ve confirmed that the desktop.css is not loading in IE 7 and 8. It seems to be ignoring that stylesheet completely.

I then tried changing the conditional statement to <!-- [if IE 8]> but that didn’t have any effect.

Lastly, I removed the condition statement altogether, resulting in this code:

<link rel="Stylesheet" type="text/css" href="/css/mobile.css" media="all"/>
<link rel="Stylesheet" type="text/css" href="/css/desktop.css" media="all" />

This last attempt results in my desktop.css being loaded in IE7 and IE8. So this proves the CSS is OK. Just looks like my conditional statement isn’t being triggered.

Any ideas what I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:08:59+00:00Added an answer on May 22, 2026 at 1:08 pm

    Remove the spaces. This breaks the conditional syntax. Otherwise, IE is treating it like a normal comment.

    <!--[if IE 8]>
    ...
    <![endif]-->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem. I have a bunch webpage that makes heavy use of
I have a HTML/CSS File laid out with a bunch of areas that need
We have a js/html/css widget that we use on our client's web sites and
I have a bunch of CSS files that get loaded on every page (header,
I have a bunch of html files that come with my app and are
I have a bunch of code in a routine that looks a bit like
I have a bunch of strings that are dependent on static dictionaries and each
I have a bunch of CSS files with a bunch of classes. I know
I have a bunch of li elements that I want to alternate in color
In my root directory I have a bunch of single pages and then the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.