I have difficulties centering an image horizontally. I already tried searching for some source codes, but couldn’t make it work so far. Can someone help us out here? This is the current source code of ht relevant section
Thanks for the code and you have reached the German community here but we can chat in English too, that’s no problemo!
To center an image horizontally in your Shopify theme, you can modify the “alignment” property in the source code you provided. Currently, it is set to “center,” which should center the image horizontally, but it seems like it’s not working for you.
One possible solution is to use CSS to center the image. Here’s an updated version of your code with the necessary CSS added:
In the updated code, I’ve changed the “alignment” property to “none” and added a “custom_css” property. The “custom_css” property contains CSS styles to center the image horizontally by setting the left and right margins to “auto.” This approach should override any default alignment settings and center the image.
This code suggestion is without guarantee though as it is theme-dependent and if you have any further issues with it, please post your questions in our Design Forum where there are a few of our experts from India that can help out!
Thanks for the quick reply, Gabe! I wrote in English as I was hoping to reach more people
I tried your suggestion. Unfortunately I still don’t see any improvements Do you have another idea what to change? The Theme we are using is called Motion-Version 10.0.0. Thanks a lot!
I could give you loads of more code suggestions that you can test in the new CSS Editor in your Motion Theme (great sandbox for safely testing out CSS code) or you could ask in our design forum (see some similar questions asked here).
Ultimately though, you will need a Liquid expert to take a deep dive into your code to achieve exactly that what you want. Have you tried asking the Motion Theme dev? They are often quite accommodating.
And have you updated your Motion theme to v. 10.3.2? I’m seeing some amazing enhancements to Images in the newer versions: