• Hello everyone,

    I used the Image Block in the WordPress editor and wrote text next to the image by aligning the image to the left or right. Initially, the text appears beside the image, but as soon as the text becomes longer and exceeds the height of the image, the text no longer wraps around the image. Instead, it continues below the image.

    Is there a way to make the text properly wrap around the image even when the text is longer than the image? I have tried the alignment options, but it does not work as expected.

    If anyone has any suggestions that can solve this issue, I would really appreciate your help.

    Thank you in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @moon7deaf ,

    To ensure the text wraps around the image in WordPress even when the text exceeds the image height, you can apply custom CSS to modify the default behavior. WordPress’s alignment settings may not always handle text wrapping consistently when dealing with larger amounts of text. Here’s a solution using CSS to force the text to wrap around the image properly:

    1. Go to Appearance > Customize in your WordPress dashboard.
    2. Navigate to Additional CSS, where you can add custom CSS.
    3. Add the following CSS code:
    img.alignleft, img.alignright {
    float: left; /* or right if the image is aligned right */
    margin-right: 15px; /* Add space between the image and the text */
    margin-bottom: 15px; /* Optional: space below the image */
    }

    img.alignright {
    float: right;
    margin-left: 15px; /* Space between text and image on the left */
    margin-bottom: 15px; /* Optional: space below the image */
    }

    p {
    clear: none; /* Prevents text from dropping below the image */
    }

    This will ensure the image remains aligned to the left or right, and the text will wrap properly even when it exceeds the height of the image.

    Thread Starter moon7deaf

    (@moon7deaf)

    Thank you for your answer. Is there really no image block with a built-in wrap-around function for text?

    • This reply was modified 19 hours, 4 minutes ago by moon7deaf.
    Moderator bcworkz

    (@bcworkz)

    Apparently wrapping text around an image is contrary to the block concept. You wouldn’t expect a physical block to distort itself to wrap around a smaller block, wound you? ?? I’m not saying I support the concept, I’m only speculating about the reasoning behind the choice. It’s conceivable that a different theme has CSS that better supports word wrapping. It’s not necessary to have a different block for this, only different CSS.

    I couldn’t say which themes would better support word wrapping. In any case I don’t think this should be important criteria in selecting a theme. Choose a theme you like best overall. If you need to add some custom CSS to get word wrapping, so be it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.