Why are my product images getting distorted after CSS code addition?

Solved

Why are my product images getting distorted after CSS code addition?

danielsm
Tourist
6 1 2

At first my products images were getting cut off, so I've followed this guide:

Try this one. 

  • From your Shopify admin dashboard, click on "Online Store" and then "Themes".
  • Find the theme that you want to edit and click on "Actions" and then "Edit code".
  • In the "Assets" folder, click on "base.css, style.css or theme.css" file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

It fixed the crop off but my images got distorted, anyone got any suggestions?

I rather have the images be smaller

thanks in advance

 

danielsm_0-1694446898121.png

 

Accepted Solution (1)

danielsm
Tourist
6 1 2

This is an accepted solution.

I have Tried:

@media screen and (max-width: 769px) {
.template-product iframe, .template-product img {
max-width: 102%;
object-fit: contain;
height: 100%;
width: 100%;
}
}

It appears to work

View solution in original post

Reply 1 (1)

danielsm
Tourist
6 1 2

This is an accepted solution.

I have Tried:

@media screen and (max-width: 769px) {
.template-product iframe, .template-product img {
max-width: 102%;
object-fit: contain;
height: 100%;
width: 100%;
}
}

It appears to work