<div class="food"> <a href="#"> <img class="image1" src="<?php echo get_stylesheet_directory_uri(); ?>/price1.jpg"></img> </a> <a href="#"> <img class="image2" src="<?php echo get_stylesheet_directory_uri(); ?>/price2.jpg"></img> </a> <a id="price3" href="#"> <img src="<?php echo get_stylesheet_directory_uri(); ?>/price4.jpg"></img> </a> </div>
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.
Is this the approach to take or is there any better way?
Cheers

New Topic/Question
Reply



MultiQuote





|