Hi there
We have issues with centre-aligning images on our blog posts.
Despite centre-aligning them on the backend directly on each blog post, they often have issues and aligned to the left.
I have added this bit of code to theme.css.liquid, but it didn’t change anything.
.article__grid-image-container,
figure.image {
text-align: center;
Our store is Kitblake.com
Thanks for your help.
2 Likes
Hi @Kitblaketrouser ,
I am assuming that you are using the feature that Shopify has in aligning images. See image below
To use the feature.
-
From you Admin page, go to Online store > Blog post
-
Go to the blog you want to edit.
-
Inside the content, click the image you want to align. This should highlight the image in blue
-
Click the “Edit image icon”, see image below
Thanks very much, I have done this for all images but it still doesn’t work, they’re aligned on the left.
1 Like
Hello @Kitblaketrouser
Here is the code for you.
.article__grid-image-container,
figure.image {
position:relative;
left: 50%;
transform:translateX(-50%);
}
Also, I am including the image of how it will look once implemented.
Thanks @adsrole can you please confirm in what part of the theme code should I add this code?
Thanks!
Hello @Kitblaketrouser
<img style= “position:relative; left: 50%; transform:translateX(-50%);”
You can use it like this or share the class name to help you further.
Thanks Austin, but it doesn’t seem to work, weirdly.
1 Like
Hi there,
We are experiencing the same problem. I keep aligning to the centre and the text does but not the images. I’ve tried everything including adding code! Anything else you could suggest?
Where should I input this bit of code- <img style= “position:relative; left: 50%; transform:translateX(-50%);” ?
Thank you,
Eloise
1 Like