[Resolved] Align images differently on mobile view

Home Forums Support [Resolved] Align images differently on mobile view

Home Forums Support Align images differently on mobile view

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1678571
    Manuela

    Hello,

    In my article I have 2 images, one aligned to the left, and the other to the right. This works for desktop.

    I would like to know if there is a way to center the images just on mobile view.

    Thank you very much,

    #1678613
    David
    Staff
    Customer Support

    Hi there,

    try this CSS:

    @media(max-width: 768px) {
    
      .wp-block-image figure.alignleft,
      .wp-block-image figure.alignright {
        float: none;
        margin: 0;
      }
    
      .wp-block-image figure.alignleft img,
      .wp-block-image figure.alignright img {
        width: 100%;
      }
    }

    This will apply to any align-left/right images you add to any of your posts.

    #1678663
    Manuela

    Thank you very much!

    #1678991
    David
    Staff
    Customer Support

    You’re welcome

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