• Hi! i would like to centre all page and post images across entire blog using CSS. Some of my older images are smaller and sit on the left side of the blog in an untidy fashion. I managed to do it with the below code BUT it affects other things too. For exmample, tt also undesirably centres the icons on the comments. How do I pick out the images from the gallery only?

    .site-content img {

    max-width: 100%; /*some screens look weird above certain amount*/
    display: block; /*centre… */
    margin: auto;/*…image*/
    }

Viewing 1 replies (of 1 total)
  • Thread Starter nicholasgault

    (@nicholasgault)

    OK, I worked it out I think:using the “.entry-content” class identifier seems to select only the images in the actual post instead of the whole page.

    .entry-content img {
    display: block;
    margin: 0 auto;
    }

    • This reply was modified 7 years, 8 months ago by nicholasgault.
Viewing 1 replies (of 1 total)
  • The topic ‘Centre all images across entire blog’ is closed to new replies.