I have a simple image section without any text. The image is automatically left-aligned and I would like for it to be centered. Would anyone know how to accomplish this?
store: www.leatherandmoreinhickory.com
Theme: Trademark
Section:
{{ section.settings.image_1 | img_url: ‘2048x’ | img_tag }}
{% schema %}
{
“name”: “Image justified”,
“settings”: [
{
“type”: “image_picker”,
“id”: “image_1”,
“label”: “Image”
}
],
“presets”: [
{
“name”: “Image”,
“category”: “Content”
}
]
}
{% endschema %}
1 Like
made4Uo
November 18, 2022, 8:21pm
2
Hi @MatthewChandler ,
Please follow the instructions below to make the image centered
From your Admin Page, click Online Store > Themes >Actions > Edit code
In the Asset folder, open the theme.css
Paste the code below at the very bottom of the file.
div#shopify-section-1aee553b-4b96-4fa7-9817-1a59ac650b05 {
display: flex;
justify-content: center;
align-items: center;
}
1 Like
I added the code and it didn’t seem to have any effect on it.
1 Like
made4Uo
November 18, 2022, 9:12pm
4
The section ID got changed. Try the code below instead, same instruction
#main .shopify-section:nth-child(14) {
display: flex;
justify-content: center;
align-items: center;
}
1 Like
Yes, that fixed it! May I ask you how I can find the section codes so I can do this with other sections? That makes so much sense now.
I’m sorry, the Section ID is what I meant.
1 Like
made4Uo
November 18, 2022, 10:02pm
7
@MatthewChandler
I change the code so it calls the 14th child of the main, Refer to the image below
1 Like