Someone might be able to help if you post a link to your site where the problem can be seen.
Thread Starter
ehnree
(@ehnree)
My site is here:
http://henryzhou.me/
In my two most recent posts, the images won’t align in the middle for some reason.
The W3C HTML Validator shows that you have some unclosed <p> tags. That could be the cause of the problem.
Also, not every image has ‘aligncenter’ set.
Thread Starter
ehnree
(@ehnree)
I pasted the image alignment code into my site’s style.css, but it didn’t solve the issue.
Thread Starter
ehnree
(@ehnree)
Still very much so confused. it seems like the image in my first post aligned correctly. However, images stopped aligning in the middle after that.
Thread Starter
ehnree
(@ehnree)
Every image with a caption is coded within a caption bracket. Upon removing the caption brackets and inserting “align=”middle”” into the img src, it still does not align in the center.
Thread Starter
ehnree
(@ehnree)
is there a specific place where I am supposed to paste my img.align code in style.css? I pasted it underneath the global styles section.
In general, if you want to add styles, you add them to the end of the style.css file, not in the middle.
If your theme provides a way to enter custom CSS, use that. Otherwise, you should create a Child theme or use a CSS plugin such as Simple Custom CSS to make your changes. If you do not, all of your changes will be lost if you update your theme.
You can test this by adding it to the end of your theme’s style.css, but to make it permanent, you should do as suggested above:
.aligncenter { margin: 0 auto !important;}
Thread Starter
ehnree
(@ehnree)
Adding the .align classes to the end of the CSS file worked. Many thanks vtxyzzy and Dave Naylor.
Thread Starter
ehnree
(@ehnree)
Now… to read up on why the captions aren’t aligning in the middle…
Thread Starter
ehnree
(@ehnree)
I made another post and it looks like it broke again.