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

  • Home
  • SEARCH
  • 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 5980855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:51:39+00:00 2026-05-22T21:51:39+00:00

How to change the meta viewport based on device resolution? we can use media

  • 0

How to change the meta viewport based on device resolution? we can use media queries to target different resolution screens how can set different viewport?

like my demo site works ok in iPad with this meta tag

<meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1, maximum-scale=1, minimum-scale=1" />

but for iphone4 I need this

<meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=.5, maximum-scale=.5, minimum-scale=.5" />
  • 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-22T21:51:39+00:00Added an answer on May 22, 2026 at 9:51 pm
    //test for iOS retina display
    $.mobile.media("screen and (-webkit-min-device-pixel-ratio: 2)");
    

    Docs: http://jquerymobile.com/demos/1.0a4.1/#docs/api/mediahelpers.html

    UPDATE:

    After looking for a minute I found the jQuery can change the meta tag.

    Try something like this:

    // Check for iPhone screen size
    if($.mobile.media("screen and (min-width: 320px)")) {
        // Check for iPhone4 Retina Display
        if($.mobile.media("screen and (-webkit-min-device-pixel-ratio: 2)")) {
            $('meta[name=viewport]').attr('content','width=device-width, user-scalable=no,initial-scale=.5, maximum-scale=.5, minimum-scale=.5');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been using: <meta name=viewport content=width=device-width; initial-scale=1.0; maximum-scale=1.0;/> to get my HTML content
Can I change the URL of a page shared through the facebook like button?
can i change the char-set of the page in jquery ? i need it
I have the following html code <!DOCTYPE html> <html lang=en> <head> <meta name=viewport content=width=device-width;
I am using some old version of drupal. I would like to change meta
i used below content in html page <html> <head> <title>Example</title> <meta name=viewport content= width=device-width,
How can i change the info in the Meta class in i.e 'django.contrib.sessions.models' ,
I would like to display certain meta data fields in the edit form based
How can I change the title of the command prompt window every time I
How can I change the width of a textarea form element if I used

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.