Trying to add a margin or limit the text to the center of my page

I was trying to replace the Dawn theme description box on my website, but the text was edge to edge on the website. I want to limit the movement to the center with a little bit of room on the side.

I have barely any knowledge about CSS Liquid, so there’s not much I can do…

Is there any way I could add CSS properties, or if not, any other way to do this?

Picture below:

Ah one more thing.. This is the code I used to add the description.

{{ product.description }}

Could you share a product page link to check?

Here you go. I managed to fix the centering issue, but the margins are still too far for comfort..
https://86daf1.myshopify.com/products/crispy-cotton-tee

Hi @Rubenith , please remove code you added and using this one instead of

.product__description {
    max-width: var(--page-width) !important;
    margin: 0 auto;
    padding: 0 5rem;
}

This is result

Do I replace the whole code? Or does this go in CSS? It doesn’t work for me, only showing up with the code printed on the page instead..

Hi @Rubenith , please remove this code only


Because it causes your page look like this on mobile devices

Hi @Rubenith

Can you kindly share your store link (with the password, if any) with us? We will check it and suggest you a solution if possible.

Here it is: https://86daf1.myshopify.com/products/crispy-cotton-tee

Right I did that.. It fixed the mobile issue, but when I put the previous code into CSS or the description, it comes up with an error.. Any way to fix that?

Hi @Rubenith

This is BSS Commerce - Full-service eCommerce Agency. We’d love to suggest you this solution:

  1. Online StoreThemesEdit code

2. Find the base.css file and add this code at the end of the file:

.product__description {
    max-width: var(--page-width) !important;
    margin: 0 auto !important;
}
@media screen and (min-width: 540px) {
   .product__description{
       padding: 0 10rem !important;
   }
}

Result:

  • Mobile:

  • PC

Hope this helps you.

Yesss, it worked. Thanks for the help everyone :grinning_face_with_smiling_eyes:

Hi @Rubenith

We’re happy to see that our suggestion helped you solve the issue. Can you kindly give us a like? This can be a reference for other merchants if they have an issue like you and greatly motivate us.
Thanks in advance.

1 Like