Re: Custom section not aligned with content

Solved

Why isn't my custom section aligning correctly with the rest of the page?

Vapes4You
Excursionist
41 3 12

Hi Community,

 

I have issues aligning my custom section to the rest of the page.

 

When I add content through the standard theme, every section is aligned with the wrapper of the page.

But when I add custom code, the width is the whole page.

 

How can I fix this? I tried copying code from existing sections, but nothing worked:


display: flex;
display: inline-flex;

 

etc.

 

Kind regards

V4Y

 

Vapes4You_0-1699886618903.png

 

You're personal Vapeshop expert 🙂
Accepted Solution (1)
Uhrick
Shopify Partner
433 68 102

This is an accepted solution.

try replacing

max-width: 72.6rem;
                margin: auto;
 
with
 
max-width: 72.6rem !important;
                margin: auto !important;
 
and if that doesn't work, try pressing enter in a blank space and saving again. I've come to notice that sometimes shopify only updates visually until the previous save
Shopify Developer
Hire me for theme customizations at ricardomsilvestre@outlook.com or Upwork
Was my answer helpful to you? Please like or mark as solution

View solution in original post

Replies 8 (8)

Adenan
Tourist
9 2 2

Hi ^^ can you please send me the link? so I check this.

thank you! 🙂

Adenan K.
Helping with your technical queries! If I've assisted you, consider buying me a little espresso (click here ✌️) to support my efforts.
Happy coding!
Vapes4You
Excursionist
41 3 12

Hi Adenan,

 

sure here is the link: https://vapes4you.de/pages/nikotin-shot-rechner

 

Thank you very much in advance!

 

Kind regards

V4Y

You're personal Vapeshop expert 🙂

Uhrick
Shopify Partner
433 68 102

hello, Vapes4you.

Can you please share the website link?

Shopify Developer
Hire me for theme customizations at ricardomsilvestre@outlook.com or Upwork
Was my answer helpful to you? Please like or mark as solution
Vapes4You
Excursionist
41 3 12

Hi Uhrick,

 

sure here is the link: https://vapes4you.de/pages/nikotin-shot-rechner

 

Thank you very much in advance!

 

Kind regards

V4Y

You're personal Vapeshop expert 🙂
Uhrick
Shopify Partner
433 68 102

go to wherever you are setting the css rules for the custom section and add these two properties:


max-width: 72.6rem;
margin: auto;

Shopify Developer
Hire me for theme customizations at ricardomsilvestre@outlook.com or Upwork
Was my answer helpful to you? Please like or mark as solution
Vapes4You
Excursionist
41 3 12

Hi Uhrick,

 

thank you for your help.

 

The tables on the page are inside divs
<div class="function-container">

I added your css to those classes but it didn't change anything:

   .function-container {
border: 2px solid #000;
padding: 20px;
                max-width: 72.6rem;
                margin: auto;
}
You're personal Vapeshop expert 🙂
Uhrick
Shopify Partner
433 68 102

This is an accepted solution.

try replacing

max-width: 72.6rem;
                margin: auto;
 
with
 
max-width: 72.6rem !important;
                margin: auto !important;
 
and if that doesn't work, try pressing enter in a blank space and saving again. I've come to notice that sometimes shopify only updates visually until the previous save
Shopify Developer
Hire me for theme customizations at ricardomsilvestre@outlook.com or Upwork
Was my answer helpful to you? Please like or mark as solution
Vapes4You
Excursionist
41 3 12

Hi Uhrick,

 

that did the trick! Thank you so much.

 

Kind regards

V4Y

You're personal Vapeshop expert 🙂