A button on the homepage contains a longer line of text, which breaks into two lines in mobile view. However the padding doesn’t adapt with multiple lines and I can’t figure out how to fix it. Is there a way to fix it without changing the original padding? Because I think the padding looks fine in single line.
My url is https://lmrv.shop
here it is on desktop view:
Here it is on mobile, the top-bottom padding is very narrow:
1 Like
Hi @alan0529 ,
Please go to Actions > Edit code > Assets > section-image-banner.css file and paste this at the bottom of the file:
.banner--mobile-bottom .banner__box {
padding: 4rem 1rem;
}
1 Like
Please add this code to the Custom CSS of that section to make it appear one line on mobile.
@media (max-width: 749px) {
.button { font-size: 18px; }
}
1 Like
Hello @alan0529
Go to online store ----> themes ----> actions ----> edit code ----> base.css
add this code at the end of the file and save.
@media only screen and (max-width: 749px) {
.button, {
font-size: 17px !important;
}
Result
Thanks
1 Like
Thank you this worked perfectly
Thanks for the help, though it seems to only work at 17px as another mentioned. Still really appreciate the help.
Thank you this also worked really well
1 Like
Hello @alan0529,
As per your requirement, to prevent the button text on your website from breaking into two lines on mobile devices, you can apply a CSS property to the button element. This ensures that the text remains on a single line, regardless of the screen size. Here is the CSS code:
.banner--mobile-bottom .banner__box {
white-space: nowrap;
overflow: hidden;
}
Or you can decrease the button text font size for the mobile device.