• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Centering Images on Mobile Devices?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Centering Images on Mobile Devices?

This topic is: not resolved

Tagged: centering image, mobile device

  • This topic has 4 replies, 2 voices, and was last updated 5 years, 1 month ago by RavenManiac.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 16, 2020 at 2:46 pm #498729
    RavenManiac
    Participant

    How can I center an image on a mobile device only? Here's the page I'm working with. Thanks!

    https://williamsburgmemorialpark.com/memorial-day-2020/
    May 16, 2020 at 3:03 pm #498730
    afreshup
    Member

    Try adding this to your custom css ... I'm guessing that the image is "memorial-day-honor-guard.jpg" This will center the image if the browser window is 600px or smaller ... adjust screen size to your needs.


    @media
    only screen and (max-width: 600px) {
    .alignright img {
    margin: 0 auto;
    }
    }

    May 16, 2020 at 4:06 pm #498731
    RavenManiac
    Participant

    @afreshup, thanks! Unfortunately, that doesn't seem to be working. I tried adding the !important property as well, but no luck. Suggestions?

    May 16, 2020 at 4:33 pm #498732
    RavenManiac
    Participant

    Okay, I tried this instead and it worked.

    @media(max-width: 600px) {
    
        .wp-block-image .alignleft,
        .wp-block-image .alignright {
            float: none;
            margin-left: auto;
            margin-right: auto;
        }
        
    }
    
    May 16, 2020 at 4:53 pm #498733
    RavenManiac
    Participant

    Ok, the solution above worked for selecting wp-block-images that are already aligned, but what if I want to select an image that is not aligned?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble