Solved

How can I prevent images from stretching in a website slideshow?

bmdms
Tourist
10 0 1

Hello,

I have a slideshow on my website, but, when the width of the screen changes, such as, a smaller/larger tab or a different device's screen, the images stretch/shrink horizontally.  How can I prevent this and preserve the dimensions of the photos?

Thanks in advance

Screenshots:

bmdms_0-1603828826964.png

 

bmdms_1-1603828852328.png

 

Accepted Solution (1)
Hardik29418
Shopify Partner
2913 419 1084

This is an accepted solution.

Please place this code at the end of file where the code is written for that content. the file may be Section -> hero-slider.liquid.

Because it is overwriting my code

paramSoft_0-1604117391823.png

 

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email

View solution in original post

Replies 9 (9)

Hardik29418
Shopify Partner
2913 419 1084

Please provide website url and if your store is password protected then also provide password

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
bmdms
Tourist
10 0 1

Here is the website

 

myhoneycreations.com

Hardik29418
Shopify Partner
2913 419 1084

Please place this code at the end of theme.scss

.home-slideshow .slick-slide img {
height: unset !important;
}

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
bmdms
Tourist
10 0 1

There is no themes.scss file for this website. Do you know where I should put it?

Hardik29418
Shopify Partner
2913 419 1084

please place this code in theme.liquid in betweeb <head></head> Like
<style>

// my given code here

</style>

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
bmdms
Tourist
10 0 1

Hmm, it still looks like the slideshow, thus the images, are still being stretch based on width of window.

Hardik29418
Shopify Partner
2913 419 1084

This is an accepted solution.

Please place this code at the end of file where the code is written for that content. the file may be Section -> hero-slider.liquid.

Because it is overwriting my code

paramSoft_0-1604117391823.png

 

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email
bmdms
Tourist
10 0 1

Awesome! It worked. Thank you so much.

 

Could you explain what the code does? Does it just lock the height of the img?

Hardik29418
Shopify Partner
2913 419 1084

I just set the height to under where before height was fixed so that images were streched.

- Need a Shopify developer? Chat on WhatsApp or EMAIL ME!


- Your Coffee Tip would do Magic code ❤️
- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Email