[Resolved] Image resize for mobile devices

Home Forums Support [Resolved] Image resize for mobile devices

Home Forums Support Image resize for mobile devices

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #586983
    Rick

    On my landing page, I have a portrait image in the content area that uses the default WordPress alignright class:
    class="alignright size-medium wp-image-157"
    However, this image does not resize for mobile devices. This is problematic for smaller viewports. Is there a CSS solution?

    #586994
    David
    Staff
    Customer Support

    Hi Rick,

    there a couple of options, you can either set two images one for mobile (small) and one for desktop (medium). And use the hide on classes listed here for each image accordingly.

    https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes

    Or you can attach your own class to the image, which we can adjust that max width on mobile like so:

    @media (max-width: 768px) {
        .my-class {
            max-width: 120px;
        }
    }
    #587162
    Rick

    Thanks, that works well when I set max-width: 50%

    #587168
    David
    Staff
    Customer Support

    That’s great. Glad i could help

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