Center Featured Image

Home Forums Gillion Theme Center Featured Image

Home Forums Gillion Theme Center Featured Image

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • tiagosimk
    Participant

    Hello, I’m using a custom CSS to resize my featured images but I noticed that the featured image is aligned to the left instead of centered, compared to the post images (See attatched image).

     

    Here is my current custom CSS:

     

    .single-post .post-thumbnail img {
    width: auto;
    height: 550;
    min-width: auto;
    }

    .single-post .post-thumbnail {
    display: block;
    }

     

     

    How can I center the image?

     

    Site URL: helenagasparetto.com.br

     

    Thanks

    Attachments:
    You must be logged in to view attached files.

    tiagosimk
    Participant

    Also, Can you help me tweak the CSS code so the featured images appear the same size as the images in the post, usually 540 x 700?

     

    Thanks

    Hi @tiagosimk,

     

    I hope you are well today and thank you for your questions.

     

    You can achieve it by adding the following CSS code in the Custom CSS code option of your theme on the below path.

     

    Admin Area -> Appearance -> Theme Settings -> Custom Code -> CSS Code

     

    .single-post #page-container .post-thumbnail img {
        margin: 0 auto;
        max-width: 540px;
        max-height: 700px;
        height: auto;
        width: auto;
    }

     

    Best regards,
    Shufflehound team

    tiagosimk
    Participant

    This last code did not work. It messed up the sizes. The one that worked fine for the height and width was:

     

    .single-post .post-thumbnail img {
    width: auto;
    height: 550;
    min-width: auto;
    }

    .single-post .post-thumbnail {
    display: block;
    }

     

     

    But it does not center the image. Can you please help me make it center the featured image? Thanks!

    To centre align it try using below custom CSS code.

     

    .single-post #page-container .post-thumbnail img {
        margin: 0 auto;
    }
Viewing 5 posts - 1 through 5 (of 5 total)