Photos not centering in modified Twenty Ten

  • Author
  • #1053271


    For some reason, now that I’ve changed my CSS in Twenty Ten by creating a child theme, some of my photos are centering with the “center” command and some are aligning to the right. Also, some of them are staying full-size, regardless of what I do with the percentage resizing tool. I think the size problem is mainly if I have a photo as the very first element on a post, but the center thing seems arbitrary. I thought it might be because it was centering across the entire page instead of the column, but that doesn’t make sense considering the results are inconsistent. Any ideas of what’s going on?

    Here’s an example of where one photo centered but another didn’t:

    Here’s an example of a photo that stayed large even though I reduced the size:
    It initially opens with a small photo, then readjusts itself to being larger.

    The blog I need help with is


    Regarding the centering, this custom CSS is causing the issue:

    #content img.alignleft, #content img.alignright, #content img.aligncenter {
    	margin-right: 15px;
    	border:1px solid #f1f1f1;

    To fix the problem, either remove the “margin-right” property or change it to “padding-right.”


    Here’s an example of a photo that stayed large even though I reduced the size:
    It initially opens with a small photo, then readjusts itself to being larger.

    This one is harder to figure out because it sounds like it might possibly be based on your process for updating image sizes (i.e. you might be doing something you didn’t mention when you change the percentage or your browser is messing it up for some reason and I can’t repeat it because of that).

    I looked at and the first image shown there has a width of 200 and a height of 300. Is that the size you were expecting to see?

    Also, when you edit the post and change reduce the size of the image, can you temporarily switch over to the text tab and let me know if the “size-medium” class goes away after you make the size change? I think it should—that’s what happened on my test blog when I tried testing this to see if I could repeat the problem.



    Yes, the “medium” went away. It looks like if I reduce the photos enough, I can eventually get them where I want them. I’m just initially seeing them in the smaller size when I open the page, then they adjust to the bigger size. It’s only doing it on these secondary pages, not the main page, which is weird. I’m wondering if it’s got something to do with me linking to the initial full-sized photo I uploaded instead of uploading it again at a smaller size? I guess I can compensate, I’m just having to reduce the image percentage way more than I did before I changed templates and added the child theme.

    As for the centering issue, your suggestion fixed it. Thank you.


    I haven’t been able to repeat the problem you described. where the images adjust to a bigger size after you open a page. Does it happen all of the secondary pages, or just some of them?

    Does it happen on this page ?

    Does the same thing happen if you try loading a secondary page in an alternate web browser as a test? (checking to see if it’s a browser-specfic problem for you)

    I tested with Chrome and Firefox on a Mac, and I couldn’t see the problem. I did notice that, in the example link you sent, the first image (of the sponsors) loads on the page first, and then the smaller book image loads after that. Because of how the images load, you *could* be perceiving that as jumping or you might be thinking that it’s showing a larger image before loading the smaller one when it’s really not. That’s the only thing I can think of based on the information you have provided so far.


    I’m closing this thread as resolved since there haven’t been any replies for a few weeks and I was unable to reproduce the problem last time I checked it. Please start a new thread if you need further help.



    I’m sorry. I got caught up in other things and forgot about it. If I need more help, I’ll do as you suggest. Thank you.

The topic ‘Photos not centering in modified Twenty Ten’ is closed to new replies.