Shopify themes, liquid, logos, and UX
Hello again!
I just finished a couple of pages with rich text (large header) but came across a problem.
The text itself is fine on mobile, but the header is too big and stretches over two or even three lines.
I googled for solutions first and came across those two:
https://community.shopify.com/c/shopify-design/how-to-reduce-the-size-of-the-rich-text-header-on-mob...
https://community.shopify.com/c/shopify-design/how-to-change-size-of-a-rich-text-mobile-version-dawn...
Unfortunately none of these work.
My section-rich-text.css is almost default, except for this line at the bottom:
.isolate .rich-text__blocks {
width: 100% !important;
max-width: calc(100% - 10rem);
}
After finding the above mentioned solutions, I tried adding this:
@media (max-width: 749px) {
.rich-text__blocks .h1 {
font-size: 6px !important;
}
}
But as I said, it didn't work. I also tried adding it above the other added block of code instead of below, but that didn't do the trick either.
I should mention that the pages in question do have a custom css I added in the theme editor, maybe that is the issue? It's simply:
h2 {
text-align: center;
}
If that's causing the issue, how do I combine these two?
And if not, what else could be the problem?
Thank you in advance!
Solved! Go to the solution
This is an accepted solution.
@GenericStoreAdm - please add this css to the very end of your base.css file and check
@media screen and (max-width:749px){
h2.rich-text__heading {font-size: 16px !important;}
.rich-text__text p{font-size: 12px !important;}
.rich-text__blocks {max-width: calc(100% - 4rem) !important;}
}
@GenericStoreAdm - can you please share your website link?
Hi @suyash1
I'll link you to one of the pages in question directly: https://pmls.at/pages/agb
The store is password protected because it's still in construction, but the password is test123?
What I forgot to mention earlier:
When I add this
@media (max-width: 749px) {
.rich-text__blocks .h1 {
font-size: 6px !important;
}
}
but without the ".h1", so this:
@media (max-width: 749px) {
.rich-text__blocks {
font-size: 6px !important;
}
}
it does successfully change the mobile font size, but again only for the text, not the heading.
It's weird that the heading seems unaffected whatsoever.
This is an accepted solution.
@GenericStoreAdm - please add this css to the very end of your base.css file and check
@media screen and (max-width:749px){
h2.rich-text__heading {font-size: 16px !important;}
.rich-text__text p{font-size: 12px !important;}
.rich-text__blocks {max-width: calc(100% - 4rem) !important;}
}
@GenericStoreAdm - welcome
Hi, this solution worked for me - but 1 problem my text is getting a little middle left aligned when I am looking at my phone view
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025