Solved

Studio Theme: How to change button width on mobile only

johnnysays
Tourist
5 0 1

Hello,

I am trying to adjust the width of my buttons on mobile only. They currently look great and work fine, but i would like to increase CRO by making my buttons on the home page (only) full width.

My website is www.aug11.co.

TYIA

Accepted Solution (1)

PageFly-Richard
Shopify Partner
4070 909 1560

This is an accepted solution.

Hi @johnnysays 

 

This is Richard from PageFly - Shopify Page Builder App

 

Please add this code to your theme.liquid above the </head> to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the </head>

{% if template contains 'index' %}
<style>
@media screen and (max-width: 767px){
a.button.button--primary {
min-width: 100% !important;
}
}
</style>
{% endif %}

PageFlyRichard_0-1704850393142.png

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 5 (5)

PageFly-Richard
Shopify Partner
4070 909 1560

This is an accepted solution.

Hi @johnnysays 

 

This is Richard from PageFly - Shopify Page Builder App

 

Please add this code to your theme.liquid above the </head> to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the </head>

{% if template contains 'index' %}
<style>
@media screen and (max-width: 767px){
a.button.button--primary {
min-width: 100% !important;
}
}
</style>
{% endif %}

PageFlyRichard_0-1704850393142.png

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

johnnysays
Tourist
5 0 1

That worked perfectly, thank you so much!

PageFly-Richard
Shopify Partner
4070 909 1560

Glad that i can help. Have a nice day ❤️

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

ZenoPageBuilder
Shopify Partner
1052 202 217

Hello @johnnysays 👋

In Shopify Admin, you can go to Edit theme code, open file base.css and add this code at the bottom

@media (max-width: 989px) {
#shopify-section-template--21613601423655__rich-text .rich-text__buttons a {
    width: 100% !important;
}
}

The result on mobile

Screenshot 2024-01-10 at 08.37.59.png

Hope that helps!

Zeno Page Builder - Build responsive & SEO-optimized Landing pages, Blog posts, Product pages and more...
Learn more at zenobuilder.com

Dan-From-Ryviu
Shopify Partner
6973 1319 1342

Go to your Online store > Themes > Edit code > open theme.liquid file, add this code below after <head> element 

{% if template == 'index' %}
<style>
@media (min-width: 749px) {
a.button--primary {
width: 100% !important;;
}
}
</style>
{% endif %}

 

- Helpful? Like or Accept solution, - Coffee Tips or Paypal Tips
- Ryviu - Product Reviews app, collect product reviews, import reviews from AliExpress, Amazon, Etsy, Shopee and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 1 month of Shopify for $1. Sign up now