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 7907313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:22:19+00:00 2026-06-03T11:22:19+00:00

I’m working on a mobile app using Phonegap (1.4.1) / JS (jQuery Mobile 1.0)

  • 0

I’m working on a mobile app using Phonegap (1.4.1) / JS (jQuery Mobile 1.0) / HTML / CSS. I’m using media queries to load the right CSS file for various screen sizes, so I have the following code to load the style sheets:

<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" media="screen and (min-width: 720px)" href="../css/XL_global.css" />
<link rel="stylesheet" media="screen and (min-width: 480px) and (max-width: 719px)" href="../css/L_global.css" />
<link rel="stylesheet" media="screen and (min-width: 320px) and (max-width: 479px)  " href="../css/M_global.css" />
<link rel="stylesheet" media="screen and (max-width: 319px) " href="../css/S_global.css" />

My problem: On my iPhone 4S, which has a screen resolution of 960×640 pixels, the stylesheet that’s loaded is M_global.css. I’m using iOS 5.1, and as far as I know, UIWebView on iOS, at least on iOS 5+ supports media queries (after all, it does load one of the stylesheets).

I’ve trie using min-device-width/max-device-width and -webkit-min-device-width/-webkit-max-device-width too, just to see if it made a difference, but it didn’t. I’ve aslo tried adding the word “only” at the front of the various above mentioned combinations (i.e. media=”only screen and (min-width: 480px) and (max-width: 719px)”), but that didn’t help either (no surprise there really).

I’ve tried setting the query conditions for the M_global.css file to min-width:0 and max-width:0 just to see if it was loading that particular stylesheet regardless, but then it didn’t load any CSS.

If this were an app I was making just for myself, for fun, I’d leave it be and just accept that it loaded the wrong CSS file and make the best of it. However, this is not for me, and I am not the one who will be maintaining this app, so it needs to be right.

Does anyone have any experience with such quirky behavior in iOS and have figured out a work-around?

  • 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-06-03T11:22:21+00:00Added an answer on June 3, 2026 at 11:22 am

    You need to test the scale, like so:

    media="-webkit-min-device-pixel-ratio: 2"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am using parse_ini_file to read the contents of a file however it is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.