Centering a featured image on the page
-
I’d like to know if there is any way to center a featured image on the page. When I set my featured images, they always end up aligned to the left margin, and I’d like to have them centered. Is there any way to accomplish this? Thanks so much
The blog I need help with is: (visible only to logged in users)
-
Hi,
I’d like to know if there is any way to center a featured image on the page. When I set my featured images, they always end up aligned to the left margin, and I’d like to have them centered. Is there any way to accomplish this?
Possibly, it will depend on how the layout is set up for your theme as to whether that will work nicely. I did some testing, and here is a bit of CSS code that will center the featured image:
.attachment-featured_image.wp-post-image { margin-left: auto; margin-right: auto; display: block; }You can add this to the Appearance > Customize > CSS area of your site, and if you like it, click Save to keep the changes.
I would however recommend that you use slightly larger images, which will have the same effect — if the images are larger, they will fill the column (and won’t sit on the left) and won’t appear blurry.
Let me know if you have any questions about this :)
- The topic ‘Centering a featured image on the page’ is closed to new replies.