WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] image alignment issue despite right css code (7 posts)

  1. Yemoonyah
    Member
    Posted 4 years ago #

    Hi

    Since I upgraded to 2.8 my images won't aligh center. Left and right work fine, but if I set them to center they do center in the editor but in the real post they align left.

    My theme css has all the apropriate code:

    /* Floats & Images */
    .right { float: right; }
    .left { float: left; }
    .middle {margin: 0 auto;float:left;}
    .clear { clear: both; }
    img.centered{display: block;margin-left: auto;margin-right: auto;max-width:950px}
    img.alignright{padding: 4px 0 4px 4px;margin: 3px 0 2px 10px;display: inline;max-width:950px}
    img.alignleft{padding: 4px 4px 4px 0;margin: 3px 10px 2px 0;display: inline;max-width:950px}
    img.alignnone{padding:4px 4px 4px 0; margin:3px 10px 2px 0;display: block;max-width:950px}
    .alignleft{float: left;}
    .alignright{float: right;}
    .aligncenter,div.aligncenter {display: block;margin-left: auto;margin-right: auto;}
    .thumbnail, .attachment-thumbnail {max-width:150px;margin:0 1.5em 1.5em 0;float:left}
    .attachment-medium {max-width:950px;overflow:hidden;display: inline}
    .attachment-large {max-width:950px;overflow:hidden;display: inline}
    .content .size-medium, content size-large {margin: 0 1.5em 1.5em 0}
    .home .size-medium, .home .size-large {max-width:590px; height:auto; overflow:hidden;margin:0 .5em .5em 0;}
    dl.gallery-item .gallery-caption {clear:both;float:none;width:150px;}
    dl.gallery-item {width:150px;}
    .gallery-icon .attachment-thumbnail{padding:0;margin:0}
    .gallery {width:auto;}

    What could be the problem?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    Could be that something else in your CSS is over-writing the standard alignment style. A link to a page demonstrating the problem might help.

  3. Yemoonyah
    Member
    Posted 4 years ago #

    EXAMPLE POST

    Thanks for helping again :-)

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    The style for home page images is over-riding the basic image alignment style

    Edit style.css (line 137) and change:

    .alignleft{float: left;}
    .alignright{float: right;}
    .aligncenter,div.aligncenter {display: block;margin-left: auto;margin-right: auto;}

    to

    .alignleft, .post .alignleft{float: left;}
    .alignright, .post .alignright{float: right;}
    .aligncenter,div.aligncenter,.post .aligncenter {display: block;margin-left: auto;margin-right: auto;}
  5. Yemoonyah
    Member
    Posted 4 years ago #

    I replaced the code but nothing changed.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    Sorry - the changes are still too high up in the stylesheet. Can you try picking up that entire block:

    `.alignleft, .post .alignleft{float: left;}
    .alignright, .post .alignright{float: right;}
    .aligncenter,div.aligncenter,.post .aligncenter {display: block;margin-left: auto;margin-right: auto;}'

    and placing right at the bottom of your stylesheet?

  7. Yemoonyah
    Member
    Posted 4 years ago #

    It works :-)

    Thanks so much for the help!!!

Topic Closed

This topic has been closed to new replies.

About this Topic