So the above works perfectly. The problem now is I am using media quiries, and for the smaller screens, I want to display two different images for image1 and image2. So, I set display:none to the third image, so now only 2 display. But how can I actually change the image urls? The only way I can think of is to remove the above and instead change it to 3 divs set to the size of the image. Then I could possibly set a background image using css, and change this background image url in the media query.

Replies To: Replacing images

Re: Replacing images

Posted 03 September 2012 - 02:59 PM

That's what I would do. The alternatives I can think of either involve using Javascript to change the src attributes, or adding a second set of <img> tags along side the first set and show or hide them in CSS based on the screen size. Neither approach is all that appealing.