# Any CSS/PHP Gurus in the House?  Image Scaling Q

**URL:** <https://boards.straightdope.com/t/any-css-php-gurus-in-the-house-image-scaling-q/462001>\
**Category:** Factual Questions\
**Created:** [September 4, 2008, 3:46pm UTC](https://boards.straightdope.com/t/any-css-php-gurus-in-the-house-image-scaling-q/462001 "2008-09-04T15:46:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mindfield](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mindfield/32/19759_2.png) [@Mindfield](https://boards.straightdope.com/u/Mindfield)\
**Post date:** [September 4, 2008, 3:46pm UTC](https://boards.straightdope.com/t/any-css-php-gurus-in-the-house-image-scaling-q/462001/1 "2008-09-04T15:46:52Z")

</div>

I’ve been driving myself batty trying to figure this out, and have had to admit defeat. The Google, it does nothing that I can use.

I have a blog. It runs WordPess. It is capable of determining whether it is being accessed by a normal computer or an iPhone, and if it detects an iPhone (or iPod Touch) it will use a subset of CSS and PHP files to construct a portable version of the blog. It works wonderfully, except for one thing. Images won’t scale. In particular, images that are contained within blog articles.

Now, I’m sure I’m correct when I say that if I’m using a separate stylesheet for the mobile blog, it should effect all content fetched from WordPress using its the\_content() method. That’s what stylesheets are for unless the stylesheet is explicitly overruled by local style changes, which I am fairly certain is not the case here.

Article images turn up full size in my mobile blog, and that’s annoying. I tried adding the following to the mobile CSS:

img {  
max-width: 90%;  
}

You’d think this would work. It doesn’t. Images still come out full size.

Without posting the entire CSS here (because it’s large), what the hell am I doing wrong?

If it helps any, the CSS and PHP files are all part of a WordPress plugin called WPTouch.

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [September 4, 2008, 4:07pm UTC](https://boards.straightdope.com/t/any-css-php-gurus-in-the-house-image-scaling-q/462001/2 "2008-09-04T16:07:27Z")

</div>

Did you check to see if the 90% works in a regular browser?

With images, if you use %, it doesn’t make the image a percent of the image’s size it makes it a percent of the size of the container it’s in.

You might need to just choose an image size for mobile - say, width: 80px - and go with that.
