Hi, I am trying to make the specific rich text container on the homepage more narrow… here is the link
https://1d9ed8-ee.myshopify.com/
Topic summary
A user seeks to narrow a specific rich text container on their Shopify homepage.
Three CSS-based solutions were provided:
-
Edit theme’s base.css file directly:
- Navigate to Online Store → Themes → Edit Code
- Locate
base.cssin the assets folder - Add CSS targeting the rich text wrapper with
max-width: 80%(adjustable percentage)
-
Use Custom CSS in the rich text section:
- Apply
max-width: 1000pxandmargin: 0 autoto.rich-text__wrapper - Includes a screenshot reference for visual guidance
- Apply
-
Responsive approach with media queries:
- Set
max-width: 80%for desktop - Use
@media (max-width: 600px)to applymax-width: 100%for mobile devices - Centers container with
margin: 0 auto
- Set
All solutions target the .rich-text__wrapper class but differ in implementation method and responsiveness. The issue remains open with multiple viable options presented.
Hi, this is really easy to do just follow the below instructions!
-
Go to ‘Online Store’ → Themes
-
From your active theme click on the 3 dots(…) → Edit Code
-
Inside the assets folder, locate the file ‘base.css’
-
At the end of the file paste the below code
.rich-text__wrapper.rich-text__wrapper--template--15352363024439__rich_text_7pfxKr .rich-text__content{
max-width: 80% /* The lower the percentage the narrower the rich text. Adjust according to your preferences */
}
Hi @selwilton
You can do that by adding this code to Custom CSS of that rich text section
.rich-text__wrapper {
max-width: 1000px;
margin: 0 auto;
}
Hi @selwilton
You can use the following code to resize the rich text container. You can set the size based on your requirements for desktop and mobile using the code below.
.rich-text__wrapper {
max-width: 80%;
margin: 0 auto;
}
@media(max-width: 600px) {
.rich-text__wrapper {
max-width: 100%;
}
}
Thanks
