html

Changing img based on window size  #angularjs #reactjs

  • I have tried using css with media queries to hide or show but it always showed both images (other media queries for resizing on the page work fine).
  • Stack Overflow works best with JavaScript enabled
  • sign up log in tour help
  • I have two separate cropped images to avoid distortion of sizing.
  • I just started adding some additional parts of the project in while awaited for help…

I wish to have my VS2015 site display a more horizontal image I have created when on a desktop and a more vertical one on a mobile device. I have two separate cropped images to avoid distortion of sizing. I have tried using css with media queries to hide or show but it always showed both images (other media queries for resizing on the page work fine). I have tried the picture tag:

@ng_real_ninja: Changing img based on window size #angularjs #reactjs

I wish to have my VS2015 site display a more horizontal image I have created when on a desktop and a more vertical one on a mobile device. I have two separate cropped images to avoid distortion of sizing. I have tried using css with media queries to hide or show but it always showed both images (other media queries for resizing on the page work fine). I have tried the picture tag:

and downloaded picture fill and added this to header

Still no success. Sorry for the newbie question but I would love some help with what seems like a simple idea.

Greg

Don’t know what I did different….. but now the code works perfect. I just started adding some additional parts of the project in while awaited for help… and it now works great.

html