• Resolved derekbeck

    (@derekbeck)


    why is that if I allow the class=”aligncenter” to persist when I use the media button to put an image into a post, for example:

    <div align="center">
    <a href="https://www.derekbeck.com/1775/wp-content/uploads/2011/03/Archibald-Robertson-Plate-25.png">
    <img src="https://www.derekbeck.com/1775/wp-content/uploads/2011/03/Archibald-Robertson-Plate-25-1024x674.png"
    style="clear: right;" alt=""
    title="Sketch of the Burning & Destroying of Castle William in Boston Harbour (Archibald Robertson)"
    width="640" height="421"
    class="aligncenter size-full wp-image-619" /></a>
    My self-placed caption
    </div>

    Then “My self-placed caption” gets a large space between it and the image. But if I simply delete the “aligncenter” from the class of the image link, “My self-placed caption” hugs the bottom of the image, just as it appears presently at my latest post: https://www.derekbeck.com/1775/info/evacuation-of-boston/
    ?

    Is there some way to easily alter the css for the aligncenter class?

    Thanks,
    Derek

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try looking in your theme’s stylesheet.

    Thread Starter derekbeck

    (@derekbeck)

    thx, will check that out!

    Thread Starter derekbeck

    (@derekbeck)

    i ended up solving by creating this solution:

    replace in the above example the line “My self-placed caption” with:

    <div class=”imgcaption”>My self-placed caption</div>

    and in my CSS I definited:

    .imgcaption {
    position: relative;
    top: -10px;
    font-size: 0.80em !important;
    padding: 0px;
    margin: 0px;
    text-align: left;
    float: none;
    }
    .imgcaptioncenter {
    text-align: center;
    }
    .imgcaptionright {
    text-align: right;
    }

    If I want it aligned center instead of left, I use:

    <div class=”imgcaption imagecaptioncenter”>My self-placed caption</div>

    Derek
    https://www.1775thebook.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘aligncenter in images creates spacing’ is closed to new replies.