I’m trying to set the max width of my Shopify desktop Home page to 1200 pixels. When screen sizes are larger than 1200 px, the page should be 1200 pixels with equal white space on both sides.
For whatever reason, the Page Width Layout setting is not doing this, and the code I’ve found from existing posts aren’t either. Any ideas?
EDIT: Figured it out. Added the following to base.css
body {
max-width: 1300px;
margin: 0px auto;
}
Hi
At base.css
You can try this code (take backup first)
/* Container for the homepage */
.page-width {
max-width: 1200px; /* Set the maximum width */
margin-left: auto; /* Center horizontally */
margin-right: auto; /* Center horizontally */
padding-left: 15px; /* Optional: add padding if needed */
padding-right: 15px; /* Optional: add padding if needed */
}
/* Optional: Adjust container for specific sections */
.homepage-section {
max-width: 100%; /* Ensure sections use full width up to max-width */
margin: 0 auto; /* Center horizontally */
}