Jump to content

Product Images in Product view not showing correctly

Recommended Posts

Site URL: https://www.handmadecrafthouse.co.uk/shop/river-frost-print

Hi, I hope someone can help me! 

I sell photography prints and it is important for my customers to be able to see the whole of the image that they will be buying. However, if they try to view my products on their mobile device then they will only see a thin slice of the actual image. I've attached images of how it should look (the wide image) and how it actually looks on mobile (the thinner one).

I'm trying to fix this with CSS and the media-screen query - I've tried content-fit rule but that doesn't seem to be working on it, although I'm not not entirely sure I'm even targeting the right thing. This is my code -

@media only screen and (max-width: 768x) {
  
  .ProductItem-gallery {
    object-fit: contain 
  }
}

Many thanks in advance

Tim

Screenshot 2020-02-13 at 12.07.04.png

Screenshot 2020-02-13 at 12.07.19.png

Link to comment
  • Replies 5
  • Created
  • Last Reply

Add to Home > Design > Custom CSS

@media screen and (max-width:640px) {
.ProductItem-gallery-slides-item img {
    width: 100% !important;
    height: auto !important;
    left: 0 !important;
}
figure.ProductItem-gallery {
    height: 250px;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
23 minutes ago, tuanphan said:

Add to Home > Design > Custom CSS


@media screen and (max-width:640px) {
.ProductItem-gallery-slides-item img {
    width: 100% !important;
    height: auto !important;
    left: 0 !important;
}
figure.ProductItem-gallery {
    height: 250px;
}
}

Marvellous! That's fixed it up a treat! Many thanks 🙂

 

Link to comment
  • 6 months later...
6 hours ago, Aerdon said:

I was looking for the same solution and came across this answer.  I tried it, but it made my picture disappear.  Looking at your site on mobile, @TPatts, your images are blank, too.  I'm using Safari for iPhone.  Is there maybe an update to this CSS, @tuanphan?  Thanks!

Can you share link to product?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.