Site logo

[Resolved] Threshold to stop wrapping text around image?

Home Forums Support [Resolved] Threshold to stop wrapping text around image?

Home Forums Support Threshold to stop wrapping text around image?

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #1598605
    Jim

    With an image aligned to one side, the text wraps around it. Good.

    As you make the window smaller, and there is less space for text, it eventually stops wrapping and pops down below the picture. Also good.

    But it seems the threshold for wrapping is too narrow. The text starts to look pretty ugly. Is there a property to adjust that so it stops wrapping with more space beside the picture?

    #1598684
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know 🙂

    #1598728
    Jim

    Here’s one example. Just below the “Symptoms” heading starts a series of pictures on the right. The second and later all have a clear_right class so the pics don’t sit next to each other.

    Look at the second and later photos, the ones all the same width. It looks fine wide, but as the window gets narrow, first the wrapped text starts to look bad, then portions of it drop down below the pics. Eventually there’s only one line wrapped. Also watch the heading “Distribution and Damage”. At one point you can see it break in two, one part remaining wrapped and the rest dropping down.
    https://forestpathology.org/root-diseases/big-pocket/

    Here’s a simpler example with one pic and no clear_right. See the pic of man with tree below the heading “Multiple Decline Concepts”. Again, as window gets smaller, it starts to look bad, then part of the text drops below and the rest stays wrapped.
    https://forestpathology.org/decline-diseases/

    #1598865
    Leo
    Staff
    Customer Support

    Hmm this isn’t normal behaviour.

    Can you disable WP optimize to test?

    #1598932
    Jim

    Thanks. I deactivated WP-Optimize and checked those pages again – no change. Then I reactivated it – not sure if you meant you wanted to test.

    #1598934
    Jim

    I deactivated WP-Optimize and checked those pages again – no change. Then I reactivated it – not sure if you meant you wanted to test yourself.

    #1598965
    Leo
    Staff
    Customer Support

    Can you deactivate all plugins except GP Premium and let me have a look?

    Thanks 🙂

    #1599672
    Jim

    Yes. Please see private info. It doesn’t seem to make any difference.

    #1599728
    David
    Staff
    Customer Support

    Hi there,

    you could do a couple of things with some CSS:

    /* limit image width to 50% of viewport */
    .wp-block-image figure.alignright {
        max-width: 50vw;
    }
    /* On smaller screens stack the images */
    @media(max-width: 768px) {
        .wp-block-image.clear_right,
        .wp-block-image figure.alignright {
            float: none;
            margin: 0;
            max-width: unset;
            width: 100%;
        }
        .wp-block-image figure.alignright img {
            width: 100%;
        }
    }
    #1599909
    Jim

    Thanks, but I’m a bit confused. Yesterday Leo said this was not normal behavior. I don’t know what normal behavior is. Could you link me to a GP site that has text wrapping around images and works normally?

    If mine is not normal, I’d rather find out why than work around it.

    #1600078
    David
    Staff
    Customer Support

    Floats behaviour can be unpredictable depending on the content around it – for example on this post:

    https://forestpathology.org/decline-diseases/

    When the screen is narrowed it comes a point where the word ‘acknowledging’ is too wide to fill the remaining space and falls below the image. To stop that from happening would require the word to break and become hyphenated which is not pretty.

    The solution i provided is the best way to fix that.

    #1600156
    Jim

    Ok, so it sounds like what I’m seeing is normal behavior after all? I’ll try that css and see how it goes.

    #1600502
    David
    Staff
    Customer Support

    I would prefer to say yes, you’re seeing the ‘weird’ behaviour of floats 🙂
    Let us know how the CSS works for you.

    #1602926
    Jim

    I don’t know why, but each of those two css rules, individually and together, cause a critical error. I double checked the semicolons and braces, all seems right. Strange.

    It’s got to be something I screwed up elsewhere in functions.php. I’ll work on it.

    DOH! Finally realized I was putting CSS in functions.php!

    #1602993
    David
    Staff
    Customer Support

    Yep – that will break it 🙂
    Glad to hear you found the issue – did this CSS resolve the narrowing text problem ?

Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.