Centre Specific Rich Text on Mobile

Solved

Centre Specific Rich Text on Mobile

ellacoker
Shopify Partner
258 0 59

Hello,

Can someone give me the css that I can put into the specific section code to align only on this rich text section? Instead of going through base css

I want it centred on mobile, left on desktop. Thank you!

URL: https://www.livwithin.com.au/?_ab=0&_fd=0&_sc=1

PW: pewpog

Screenshot 2025-03-18 at 15.50.42.png

Accepted Solution (1)

PageFly-Richard
Shopify Partner
5011 1120 1801

This is an accepted solution.

 

Hi @ellacoker 

 

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>

 
<style>
@media (max-width: 767px) {
#shopify-section-template--19130582892786__rich_text h2 {
    font-size: 18px;
    text-align: center;
}
}
</style>

PageFlyRichard_0-1742366140669.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 7 (7)

Mustafa_Ali
Excursionist
322 24 53
<style>
@media screen and (max-width: 767px) {
h2.rich-text__heading.rte.inline-richtext.h2.scroll-trigger.animate--slide-in {
    text-align: center;
    margin-bottom: 15px;
 }
}
</style>

MustafA16_0-1742277471605.png

try this one and if this is help ful to you then please do not forget to like and mark it solution

 

Mustafa_Ali
Excursionist
322 24 53
<style>
@media screen and (min-width: 768px) {
h2.rich-text__heading.rte.inline-richtext.h2.scroll-trigger.animate--slide-in {
    margin-left: -20px !important;
 }
}
</style>

MustafA16_1-1742277695556.png

in desktop try this one 

 

GTLOfficial
Shopify Partner
828 171 187

Hello @ellacoker 
Go to online store ----> themes ----> actions ----> edit code ----> base.css
add this code at the end of the file and save.

@media screen and (max-width: 768px) {
.rich-text__heading.rte.inline-richtext.h2.scroll-trigger.animate--slide-in {
text-align: center;
margin-bottom: 17px !important;
}
}

result
34.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh

Moeed
Shopify Partner
7334 1989 2424

Hey @ellacoker 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
.rich-text__blocks {
    text-align: -webkit-center !important;
}
</style>

RESULT:

Moeed_0-1742278898997.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


Dan-From-Ryviu
Shopify Partner
11530 2256 2436

Please add this code to Custom CSS of that section.

@media (max-width: 749px) {
h2 { text-align: center; }
}

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

ellacoker
Shopify Partner
258 0 59

Hello, for some reason, this didnt work. Please see screenshot

Screenshot 2025-03-19 at 15.18.13.png

PageFly-Richard
Shopify Partner
5011 1120 1801

This is an accepted solution.

 

Hi @ellacoker 

 

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>

 
<style>
@media (max-width: 767px) {
#shopify-section-template--19130582892786__rich_text h2 {
    font-size: 18px;
    text-align: center;
}
}
</style>

PageFlyRichard_0-1742366140669.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.