Studio Theme: How to change button width on mobile only

Solved

Studio Theme: How to change button width on mobile only

johnnysays
Tourist
11 0 5

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
4902 1102 1779

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!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


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
4902 1102 1779

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!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


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

johnnysays
Tourist
11 0 5

That worked perfectly, thank you so much!

PageFly-Richard
Shopify Partner
4902 1102 1779

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!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


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

ZenoPageBuilder
Shopify Partner
1052 203 229

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
10959 2148 2287

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 %}

 

- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.