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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:36:02+00:00 2026-05-15T23:36:02+00:00

I want to have a webview that has a single HTML and a single

  • 0

I want to have a webview that has a single HTML and a single CSS file, shows graphics at the same size, but native resolution for each.

My existing webviews, designed for 320×480 seems to scaled up well (crisp text and border-radius for instance), though images are at half res in the iPhone4 simulator. How do I simulate the native image loading behaviour where a graphic or it’s double res version is chosen automatically with HTML, CSS, or JS? (hopefully not JS)

I’m currently using a viewport declaration like so:

<meta content='initial-scale=0.5; maximum-scale=1.0; minimum-scale=0.5; user-scalable=0;' name='viewport' /> 

This zooms out and image pixels are 1:1 with display pixels, but it also scales down everything else. And of course makes it tiny on the smaller iPhone display.

I have a feeling this has something to do with some sort of viewport size media query?

  • 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-15T23:36:03+00:00Added an answer on May 15, 2026 at 11:36 pm

    I stumbled on this the other day: http://aralbalkan.com/3331

    This will load an iPhone 4 stylesheet

    <link
        rel="stylesheet"
        type="text/css"
        href="/css/retina.css"
        media="only screen and (-webkit-min-device-pixel-ratio: 2)"
    />
    

    Then in your low res stylesheet the magic move is to set your background size property to the size of the low res image.

    .demoImage
    {
        background-image: url(../images/my-image-64.png);
        background-size: 64px 64px;
        background-repeat: no-repeat;
    }
    

    Now in retina.css simply show the double res version

    .demoImage
    {
        background-image: url(../images/my-image-128.png);
    }
    

    Now the css background image will display a 128×128 image as if it was 64 css pixels providing a 1:1 image pixel to display pixel image display on an iPhone 4.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WebView that loads a local HTML file like this: [webView loadRequest:[NSURLRequest
I have view that has a webview and a UIToolbar. I want to create
I have a webview, which shows the pages of a ebook. I want to
I have a WebView that is loading a page from the Internet. I want
I have an android application that hits the WebView and displays the content. But
I have got a PHP/HTML page where I want to fetch data from but
I have a UIWebView (that has been sized to fully contain the html) and
I have a Android 2.1 application with a WebView. In that WebView I want
I have an Android WebView that has JavaScript that is calling Android methods through
So I have a UIView which has a UIWebView and I want so that

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.