Shopify themes, liquid, logos, and UX
The collection banner on desktop is perfect but when the same banner is cropped when viewed on mobile. can someone help me here?
Solved! Go to the solution
This is an accepted solution.
@shwetart
- please add following code at the bottom of the file theme.scss.liquid.
File Path: online store > themes > live theme > action > edit code > assets > theme.scss.liquid
@media only screen and (max-width: 600px) {
.collection__image-wrapper--small {
height: 96px !important;
}
.collection__image{
background-size: contain !important;
background-position: center !important;
background-repeat: no-repeat !important;
}
}
This is an accepted solution.
Please add the following code at the bottom of your assets/theme.scss.liquid file.
@media screen and (max-width: 640px) {
.collection__image-wrapper--small {height: 82px !important;}
.collection__image {
height: 100%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
}
Hope this helps.
Thanks!
Please share your website URL and password if any. I will check and provide a solution here.
Thanks!
yes, please provide the web url here @shwetart
This is an accepted solution.
@shwetart
- please add following code at the bottom of the file theme.scss.liquid.
File Path: online store > themes > live theme > action > edit code > assets > theme.scss.liquid
@media only screen and (max-width: 600px) {
.collection__image-wrapper--small {
height: 96px !important;
}
.collection__image{
background-size: contain !important;
background-position: center !important;
background-repeat: no-repeat !important;
}
}
This is an accepted solution.
Please add the following code at the bottom of your assets/theme.scss.liquid file.
@media screen and (max-width: 640px) {
.collection__image-wrapper--small {height: 82px !important;}
.collection__image {
height: 100%;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
}
Hope this helps.
Thanks!
Thank you so much .. it fit exactly
Thank you so much ...
If helpful then please Like and Accept Solution.
Thank you for the solution , but I have another problem here. The size though now fits well for mobile view, I had not realised that on desktop the view is also cropped:(.
The size of the category banner is 2000*450
please check this on desktop - https://www.mystiqliving.com/collections/specials
Please add the following code at the bottom of your assets/theme.scss.liquid file.
@media screen and (min-width: 641px) {
.collection__image-wrapper--small {height: 320px !important;}
}
Hope this works.
Thanks!
I amended the code but now the sides are cropped.. the height is fine but not the width
can you share screenshot please?
Please add the following code at the bottom of your assets/theme.scss.liquid file
@media screen and (min-width: 641px) {
.collection__image {
height: 100%;
background-size: contain;
background-position: center;
width: 100%;
background-repeat: no-repeat;
}
}
Hope this works.
Thanks!
also add this CSS without @media
.collection__image {
height: 100% !important;
background-size: contain !important;
background-position: center !important;
width: 100% !important;
background-repeat: no-repeat !important;
}
Hope this works.
Thanks!
Can you help me to get perfect banner size for my site innofur.com
User | RANK |
---|---|
177 | |
153 | |
72 | |
36 | |
36 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023