WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Posts Not Centering (4 posts)

  1. David_1
    Member
    Posted 7 months ago #

    Hello Friends,

    Using the Twenty Fourteen theme and have run into an image issue and wondering if someone would be willing to take a peek and advise.

    For some reason regarding my Post's, the images have a greyed out area to the right of the image. I have tried some css such as:

    }
    .post-thumbnail {
    	float: right;
    }
    
    and 
    
    }
    .post-thumbnail {
    	align: center;
    }

    However that doesn't do anything as it moves the whole area over. I just want the image to move, (center would be perfect) and get rid of the greyed area.

    http://i-brand.ca/custom-theme-wordpress/

    If anyone can lend a thought or a hand, I would be most grate ful. Many thanks in advance for taking a look.

  2. vtxyzzy
    Member
    Posted 7 months ago #

    You can get rid of the grey area by setting the background to none. You may also be able to use a left margin to provide a little space on the left. Try adding this to the end of your child theme's style.css:

    .post-thumbnail {
        background: none;
        margin-left: 10px;
    }
  3. Evan Herman
    Member
    Posted 7 months ago #

    The greyed out area is default to the TwentyFourteen theme. Any image that does not fit the entire crop area will have these grey horizontal bars to the left and right of the image.

    In regards to getting the image centered, this code will work wonders:

    .post-thumbnail img {
      display:block;
      margin:0 auto;
    }

    You will then see the grey bars to the left and the right of the image, which I had mentioned above. I would use vtxyzzy's code to remove the bars.

    Or just use:

    .post-thumbnail {
        background: none;
    }

    Evan

  4. David_1
    Member
    Posted 7 months ago #

    vtxyzzy & Evan,

    You were both spot on and again many thanks!

Reply

You must log in to post.

About this Topic