How can I adjust button and font size for mobile layout?

How can I adjust button and font size for mobile layout?

AlexDaSilva
New Member
16 0 0

Hi. On my home page I have 2 image elements that have clickable buttons. On the desktop layout the buttons are well sized but when i switch to mobile, the buttons become uncentered and are too big and the font is too big causing it to stack the words on top of each other rather than in one straight line. What code can I used to adjust the button size and font, and centre them on the images, for the mobile layout. Thanks! 

Website is: 

www.prettylittleskin.co.za 

Screenshot 2024-02-27 at 19.52.35.png

 See mobile layout above, and desktop layout below. 

Screenshot 2024-02-27 at 19.53.23.png

Replies 2 (2)

biznazz101
Shopify Partner
494 50 97

You can try this:

Go To Themes> Customize> Click On Section> Add This Code To Sections Custom CSS Settings> Save

.button {
  font-size: 1.2rem;
  letter-spacing: .1rem;
  line-height: calc(1 + .2 / var(--font-body-scale));
  min-width: 150px;
}

 

Result:

biznazz101_0-1709064283936.pngbiznazz101_1-1709064644797.png



Hope that helps,
@biznazz101 

Don't hesitate to reach out for more help with your store.
SEE OUR TASK STORE or check us out via our profile! FREE STORE AUDIT
AlexDaSilva
New Member
16 0 0

So I've added that code and it changed the font size, however the buttons are still not aligned with the images (see below) 

Screenshot 2024-02-28 at 08.21.26.png