hello,
i would like to add padding above this button to seperate it out from the text a little. what code can i use for this? thank you.
ella.
PW: ellacoker
A Shopify store owner needs to add padding above a button in mobile view to separate it from text above.
Problem Details:
Solutions Provided:
Three community members offered CSS-based solutions:
ChiragPatel2911 (posted twice): Suggested adding media query CSS to base.css file targeting .rich-text--full-width .rich-text__buttons with padding-top: 20px
theycallmemakka: Provided custom CSS to add in theme.liquid file before </body> tag, with additional note about optimizing cover image dimensions (recommending rectangular over square images)
LizHoang: Recommended adding CSS via Theme Customizer’s Custom CSS section, targeting .rich-text__buttons.scroll-trigger.animate--slide-in with padding-top: 50px !important, included visual result screenshot
Resolution:
The original poster confirmed LizHoang’s solution worked perfectly, marking the issue as resolved.
hello,
i would like to add padding above this button to seperate it out from the text a little. what code can i use for this? thank you.
ella.
PW: ellacoker
Hello @ellacoker
You can add a custom CSS under your theme file.
Go to the Online Store → Edit your theme code and find the base.css
@media(max-width:768px){
.rich-text–full-width .rich-text__buttons {
padding-top: 20px;
}
}
Add this CSS at the end of that base.css file and save it. I hope that works for you.
Hi @ellacoker ,
I have written custom CSS for this solution. Please follow below steps and let me know your feedback.
Note: As you are using a square image as a cover image, the height of the image will be quite large to display all the images. The height of the section will be equal to the width of the screen. For optimum results, I recommend using a rectangular image.
Follow these Steps:
Go to Online Store
Edit Code
Find theme.liquid file
Add the following code just above tag
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka
Hello @ellacoker
You can add a custom CSS under your theme file.
Go to the Online Store → Edit your theme code and find the base.css
@media(max-width:768px){
.rich-text–full-width .rich-text__buttons {
padding-top: 20px;
}
}
Add this CSS at the end of that base.css file and save it. I hope that works for you.
Hi @ellacoker
You can follow this instruction:
Go to Shopify > Theme > Customize
Copy and paste this code on Theme settings > Custom CSS section
.rich-text__buttons.scroll-trigger.animate--slide-in {
padding-top: 50px !important;
}
Result :
Thank you Liz, this is great!
thank you so much! this worked perfectly.