Back to top

Affiliate Link: Interested In a Useful Tables For Amazon Products and More? Check Out:

Amalinks Pro

Center a Smaller Featured Image In Post Display

As an Amazon Associate we earn from qualifying purchases made on our website. If you make a purchase through links from this website, we may get a small share of the sale from Amazon and other similar affiliate programs. You can read our complete legal information for more details.

If you choose to use a featured image display on your post and you don’t have a wide enough image it will look odd when shoved to the left-hand side.

Recently someone requested on Facebook how to center this featured image when not a full-size image to make it appear correct in the presentation.

Below is some simple Custom CSS which will help ensure the featured image in each post will be centered and look good when you choose to display them.

div.post-thumbnail > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

If you find a post helpful and feel like rewarding my effort with the price of a beer, please donate here

About Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals! Read More About Me...

My Posts | Website

Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals! Read More About Me...

6 thoughts on “Center a Smaller Featured Image In Post Display

  1. Hi Josh, thanks for providing this css script.

    I tried this code but it sill has not aligned it in the center.

    Is there anything more to do?

    Let me know.

    Thanks.

  2. Works great. Looked all over for this and found it here. Another question about featured images Josh. In the recent posts the featured image is cut off. I even installed ShortPixel which is supposed to make thumbnails so this won’t happen. Look at it on the pic with the treasure chest on my blog home page at rejuvenotes dot com

    Note: Notice how the image is cut off. If I make the image smaller it won’t cover the entire area at the top of the post.

    1. ShortPixel doesn’t have anything to do with images being cut off. If the settings on ShortPixel make an image outside of 3:2 ration it will have to be hidden.

      You need to change shortpixel to stop making images 950pixels which is the default setting and one no one seems to change. Make it at least 1024 or 1200, then go to my image fix post which helps set you up for images that will work for featured without causing you more issues.

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Content