Center align image in sidebar
-
Hi!
I have added a image widget to the sidebar but the image is not center aligned. Is there any way to fix that? It looks terrible that it is left aligned when everything else is center aligned 🙁
Thanks!
The page I need help with: [log in to see the link]
-
Hello @dailydotssk,
Hope you are having a great day and thanks for contacting us!
Please go to WP Admin > Appearance > Customize > Additional CSS and inside that box, add the following code:
#media_image-20 img { width: 100%; }Try it and let me know how it worked.
Kind regards,
DiegoYeah that worked perfectly. But now the image is quite large. Is there any way that I can scale it to be a little smaller?
I just realized that it the CSS only changed the image when my site is in English. When I change the language to Danish, the image is still left aligned. Is there any way to fix that?
Hi @dailydotssk,
Using this code will align the image in both languages:
#media_image-18 img, #media_image-20 img { width: 100%; }Regarding making it smaller, you could remove the code I gave you and add a little margin on the left to move it to the center, but that won’t work well for every device. This is the way to solve this and make it responsive.
Please, let me know if you need any further assistance.
Kind regards,
DiegoThanks that solved my problem.
To make the image smaller I ended up just framing it in an editing app, which makes it appear smaller than it really is.
Thanks again for the great and fast support!
You’re welcome! Glad to help!
Diego
The topic ‘Center align image in sidebar’ is closed to new replies.
