WordPress.org

Ready to get started?Download WordPress

Forums

WordPress messing up image align in post (5 posts)

  1. danaherlihey
    Member
    Posted 5 years ago #

    Hi there,

    I have nothing in my style sheet that should make my image suddenly align left like this: http://tammyma.com/tammywp/?p=21
    infact, in the wordpress editor i set it to align right.

    any ideas?

  2. tugbucket
    Member
    Posted 5 years ago #

    well you gave it class="alignright" but there is no style in any CSS document on your site that defines what "alignright" is.

  3. danaherlihey
    Member
    Posted 5 years ago #

    wordpress gave it that alignment.

  4. Chris_K
    Member
    Posted 5 years ago #

    ... and it is up to your theme to handle it properly.

    Check out the stylesheet for the Default theme to get an idea of how you might handle updating your own theme.

  5. dreamkingdom
    Member
    Posted 5 years ago #

    I used to have this problem and have a solution for this. Open your stylesheet.css then add this code in, image alignment should work fine!

    img.centered {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
    img.alignright {
        padding: 4px;
        margin: 0 0 2px 7px;
        display: inline;
    }
    
    img.alignleft {
        padding: 4px;
        margin: 0 7px 2px 0;
        display: inline;
    }
    
    .alignright {
        float: right;
    }
    
    .alignleft {
        float: left;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic