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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:50:18+00:00 2026-05-27T04:50:18+00:00

In a UIWebView, I am using the CSS max-width property to scale images of

  • 0

In a UIWebView, I am using the CSS max-width property to scale images of unknown size to fill a space no larger than (but perhaps smaller than) 300 pixels wide. Some of the original images are larger, and others are smaller.

For now, I’m using the following CSS declaration, which scales the width correctly, but tends to blow out the height of larger images in the iOS WebView:

 img{
    max-width:300px;
    margin:10px;
    padding:0px;
 }

So the question is: What’s the correct way to ensure the height scales proportionally along with the width?

(Edited headline and tags to generalize solution. Thanks, matt!)

  • 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-27T04:50:19+00:00Added an answer on May 27, 2026 at 4:50 am

    You want something like this:

      img {
        max-width:300px; 
        height:auto
      }
    

    This really has nothing to do with iOS or UIWebView – it’s pure standard CSS.

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

Sidebar

Related Questions

Using CSS in a UIWebView, how can I make left-to right text flow in
I have been using the uiwebview for a app that consists a index.html,css and
I want to execute javascript code from my iPhone application using UIWebView. But only
I'm using a UIWebView to display images in base64 ( http://www.abluestar.com/utilities/encode_base64/index.php ). The UIWebView
Im creating application that will display remote page on the UIWebView using local images
i want to add map cluster in my UIWebView using google map api but
Does anybody know a possibility to center simple pictures within a UIWebview without using
I want to restrict the users from using the links in a UIWebView. Hence,
I load a UIWebView from a string in a navigation based app. I'm using
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net . But I want to

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.