• Hi,

    I’ve been having issues with image placement in both posts and pages. I can’t seem to center images nor text-wrap around images as well.

    Here’s an example of one of my posts with the centering issues:

    Here’s all the code I entered that I picked up from WP Codex:

    }
    img.alignright {float:right;
    margin:0 0 1em 1em;
    border:solid #ffde00 2px
    padding: 4px; margin: 0 0 2px 7px;
    display: inline;
    }
    
    img.alignleft {float:left;
    margin:0 1em 1em 0;
    border:solid #ffde00 2px;
    padding: 4px;
    margin: 0 0 2px 7px;
    display: inline;
    }
    
    img.aligncenter {display: block;
    margin-left: auto;
    margin-right: auto;
    border:solid #ffde00 2px;
    padding: 4px;
    margin: 0 0 2px 7px;
    display: inline;
    }
    
    p img { padding: 0; max-width: 100%; }
    
    .alignright {float:right; }
    .alignleft {float:left; }
    .aligncenter {display: block; margin-left: auto; margin-right: auto}
    .wp-caption { margin: 5px; padding: 5px; border: solid 2px #ffde00; background: #E5F2FF; font-size:90%; color: black }
    }

    Please help! It’s been driving me bonkers!

    Thanks in advance for your support!

    – Minkers

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you tried setting the alignment by clicking on the image in the post/page visual editor?

    Thread Starter queenssi3382

    (@queenssi3382)

    Yes, that’s one of the first things I’ve tried. It might center or align right in my post, but won’t show when I publish it when it’s live.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Do you have a syntax error in your stylesheet preventing this code from working?

    Thread Starter queenssi3382

    (@queenssi3382)

    I don’t think. It never states I have a syntax error.

    Considering my site designed a custom stylesheet, I couldn’t say what he put in the code to cause this issue. We have split ways since then.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It doesn’t look like your theme is outputting the classes on the images. The align classes.

    Thread Starter queenssi3382

    (@queenssi3382)

    OK great that’s good to know but I’m not very good at this coding thing.

    Any suggestions? How do I correct this?

    I do require a bit of hand-holding here for the process. Maybe something I can just copy and paste into my Editor section would be great!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image Placement Issue’ is closed to new replies.