View Full Version : Display different images for different devices?

01-05-2012, 12:08 AM
I posted this thread in the CSS forum, because I thought there might be a CSS answer, but maybe the answer is in the php?

Other thread: http://www.codingforums.com/showthread.php?t=247737

Here is what I said:

I've been told by a number of people that I can have a higher and a lower resolution version of an image and do something in the coding that makes one of them load if it's a regular computer and the other one load if it's a mobile device. I have Googled and can't find how to do this.

My mom is dead-set on using several images on the mobile version of her site, which is making the site too big according to the mobile validator that I ran the site through. I made low-res versions of the images, but don't know how to set the site to load the right one. I know how to *hide* one or the other, but apparently even if the css lists an image as "display:none;" it still loads the image and counts toward the size of the page.

Very frustrated, please help!

>^,, (http://opalcat.com)^<

01-05-2012, 12:31 AM
You realize we have a forum dedicated to mobile web development?

PHP isn't really going to help you here because PHP doesn't know anything about who is viewing the client side web page.

Just a few threads down in the mobile web development forum there is a thread asking this same question and has answers

Distinguishing between devices for proper website

01-05-2012, 02:45 AM
Thanks, I'm still learning my way around this place (it's biiiig!) I'll check out that thread.

The problem is I've had "aha! I finally found the solution!" moments so many times, only to have the solution not work for me... I'm getting discouraged...