New Shopify Certification now available: Liquid Storefronts for Theme Developers

Store info container Custom CSS - make everything fit on mobile version

Solved
miflora
Tourist
8 0 1

Hi! I am trying to find out if there is a way to make the store info content fit in the container on mobile version and get rid of the scroll bar. can it be done with CSS? 

Thanks!sample.PNG

Accepted Solution (1)
Ifzan
Shopify Partner
34 2 3

This is an accepted solution.

You can use this css
@media (max-width: 767px){
.home-store-info .store-slider {
    flex-wrap: wrap;
}
 
.home-store-info .store-slider .store-item {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 80%;
    flex: 0 0 100%;
    max-width: 100%;
    border: 0;
    border-bottom: 1px solid #e3e3e3;
}
.home-store-info .store-slider .store-item:last-child {
    border-bottom: 0px;
}
}

View solution in original post

Replies 12 (12)
Ifzan
Shopify Partner
34 2 3

Hello,

Yes possible

 

Can you please share store URL?

 

miflora
Tourist
8 0 1

here you go: miflora.shop

Ifzan
Shopify Partner
34 2 3

This is an accepted solution.

You can use this css
@media (max-width: 767px){
.home-store-info .store-slider {
    flex-wrap: wrap;
}
 
.home-store-info .store-slider .store-item {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 80%;
    flex: 0 0 100%;
    max-width: 100%;
    border: 0;
    border-bottom: 1px solid #e3e3e3;
}
.home-store-info .store-slider .store-item:last-child {
    border-bottom: 0px;
}
}
miflora
Tourist
8 0 1

This works like magic! is it possible to make it fit horizontally instead of vertical ?

Ifzan
Shopify Partner
34 2 3

Yes, But in mobile screen you need to decrease font size according to the screen.

 

Otherwise it will look like this

Ifzan
Shopify Partner
34 2 3

If you will not decrease the font size according to the screen then it will look like this

Ifzan
Shopify Partner
34 2 3

Screenshot 2023-10-09 at 4.12.25 AM.png

miflora
Tourist
8 0 1

Was able to fix it by just adjusting max-width on the css code that you provided above. Thanks again! 
solution.PNG
@media (max-width: 767px) {
.home-store-info .store-slider {
flex-wrap: wrap;
}
.home-store-info .store-slider .store-item {
-webkit-box-flex: 0;
-ms-flex: 0 0 80%;
flex: 0 0 100%;
max-width: 33%;
border: 0;
border-bottom: 1px solid #e3e3e3;
}
.home-store-info .store-slider .store-item:last-child {
border-bottom: 0px;
}
}

Ifzan
Shopify Partner
34 2 3

You need to change this in there 3 width size same otherwise it will not support some browser

 

-ms-flex: 0 0 33%;
flex: 0 0 33%;
max-width: 33%;

miflora
Tourist
8 0 1

Works great! Thank you again. 😁

Ifzan
Shopify Partner
34 2 3

You welcome!

miflora
Tourist
8 0 1

I Will try this out thank you!