How do I make the sides and the top smaller similar like CAINTE?
My website: https://onecap.se/
How do I make the sides and the top smaller similar like CAINTE?
My website: https://onecap.se/
Hello, you should probably change how your theme handles margins on the ācollectionā page template layout.
Currently, they are tied to .container; however, modifying .container impacts the width of the entire site.
That is why an update to the style logic is necessary within the code either at the section level or (more cleanly) within the themeās structure
Well, you are looking for a way to adjust the spacing from left, right, top and bottom.
here are the steps you can follow to ensure the same spacing same like the reference site.
Go to Shopify Admin ā> Online Store ā> Edit Code ā> main.css
In the end of main.css paste the following code that shared below.
.container.container--no-max.lightly-spaced-row-above {
padding-right: 10px !important;
padding-left: 10px !important;
padding-top: 20px !important;
}
Results:
The theme sets 2 CSS variables --container-pad-x which controls white space on the left and on the right and --section-padding which controls white space above section.
I am pretty sure these can be controlled somewhere in theme settings.
However, if you want to control these for some particular section, add code like this to the āCustom CSSā of these sections:
{
--container-pad-x: 16px;
--section-padding: 16px;
}
this code will only work in section Custom CSS
If you want to apply them to all template sections (not Header/Footer), you can add this code to āTheme settingsā-> āCustom CSSā:
main {
--container-pad-x: 16px;
--section-padding: 16px;
}
Currently, both set to 50px and horizontal padding is reduced to 16px on mobile.
Hey! I donāt have anything called āmain.cssā, I just got theme.liquid and the code does not work unfortunoately
Not working, I use theme.liquid
Can you show me in the screenshot on how you add the code in theme.liquid file?
First of all you are not adding the css that I provide you.
And secondly, you are adding the css without style tag. Simply remove the current css and add the following one, before the body tag.
<style>
.container.container--no-max.lightly-spaced-row-above {
padding-right: 10px !important;
padding-left: 10px !important;
padding-top: 20px !important;
}
</style>
.collection-slider-row .container.containerāno-max {
padding-inline: 10px;
}
add in that particular section
Sorry, my bad. It really worked now!! Thank you.
But It did not work on the homepage. Could you please tell me how to fix it there as well?
.collection-slider-row .container {
padding-inline: 10px;
}
reason : .containerāno-max vs .containerā-no-max
Please can you respond and help me?
Sorry, my bad. It really worked now!! Thank you.
But It did not work on the homepage. Could you please tell me how to fix it there as well?
paste this code before the body tag.
<style>
.container.container--no-max {
padding-right: 10px !important;
padding-left: 10px !important;
padding-top: 20px !important;
}
</style>
Thanks, but now the top is a bit bigger, please can you fix?
Thanks, but now the top is a bit bigger, please can you fix?
Paste this code in the theme.liquid file.
.container.container--no-max.relative {
padding-top: 0px !important;
}
Make sure, you should paste in the style tag.