What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Problem with style on mobile.

Solved

Problem with style on mobile.

AntonBjarki
Excursionist
37 0 9

I have this code in that puts the product text in the middle but it's not working on mobile. Any ideas?
Website: antonbjarkiolsen.com
pass: passwordpassword

AntonBjarki_0-1732894819298.pngAntonBjarki_1-1732894828515.pngAntonBjarki_2-1732894834073.png

 

 

 

Accepted Solution (1)
Ahmad31
Shopify Partner
116 9 8

This is an accepted solution.

 

Ahmad31_0-1732913390178.png

 

  • Log into your Shopify admin panel.
  • Go to Online Store > Themes.
  • In the Actions dropdown of the theme you're working on, select Edit Code.
  • Find theme.liquid file Add the following code in the bottom of the file above </body> tag

 

@media screen and (max-width: 767px) {
    .collection .products .product .info {
        height: auto !important;
        place-self: center !important;
        padding: 10px;
        text-align: center;
    }

    .collection .products .product .info h3 {
        font-size: 16px;
        margin: 0;
        padding: 5px 0;
        text-align: center;
    }

    .collection .products .product .info p {
        font-size: 14px;
        margin-top: 10px;
        text-align: center;
    }

    .collection .products .product img {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        display: block;
        margin: 0 auto;
    }
}

 

 

Love my work? Buy me a coffee!
Hire Me: Email me Or Chat on Whatsapp
If you found my solution helpful, please like and accept it. Your support is greatly appreciated!

View solution in original post

Replies 3 (3)

Moeed
Shopify Partner
6357 1721 2081

Hey @AntonBjarki 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.collection .products .product .info {
    height: 60px !important;
    place-self: center !important;
}
}
</style>

RESULT:

Moeed_0-1732896910205.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


AntonBjarki
Excursionist
37 0 9

Hello! the text is now centered but it's all cut.

Any ideas?

AntonBjarki_0-1732903726734.png

 

Ahmad31
Shopify Partner
116 9 8

This is an accepted solution.

 

Ahmad31_0-1732913390178.png

 

  • Log into your Shopify admin panel.
  • Go to Online Store > Themes.
  • In the Actions dropdown of the theme you're working on, select Edit Code.
  • Find theme.liquid file Add the following code in the bottom of the file above </body> tag

 

@media screen and (max-width: 767px) {
    .collection .products .product .info {
        height: auto !important;
        place-self: center !important;
        padding: 10px;
        text-align: center;
    }

    .collection .products .product .info h3 {
        font-size: 16px;
        margin: 0;
        padding: 5px 0;
        text-align: center;
    }

    .collection .products .product .info p {
        font-size: 14px;
        margin-top: 10px;
        text-align: center;
    }

    .collection .products .product img {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
        display: block;
        margin: 0 auto;
    }
}

 

 

Love my work? Buy me a coffee!
Hire Me: Email me Or Chat on Whatsapp
If you found my solution helpful, please like and accept it. Your support is greatly appreciated!