• 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

change of image alignment on smaller displays

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 › change of image alignment on smaller displays

This topic is: not resolved

Tagged: css, image alignment, problem

  • This topic has 8 replies, 2 voices, and was last updated 11 years, 4 months ago by kridgroup.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • October 17, 2014 at 3:45 pm #128192
    kridgroup
    Member

    On this specific page - using the Executive Pro theme - I have two images, which on larger displays are aligned right:

    https://www.kridconsulting.com/company/

    Now, to improve readability on smaller screens, I have adjusted the text wrap using the following:


    @media
    only screen and (max-width: 629px) {
    .alignleft, .alignright {
    clear: both;
    float: none;
    display: block;
    }
    }

    How can I in the same context change the image alignment to e.g. left?

    Thanks in advance!

    https://www.kridconsulting.com/company/
    October 17, 2014 at 5:51 pm #128208
    Sridhar Katakam
    Participant

    You can see that each image can be uniquely identified using one of its classes.

    Ex.: The Team image "wp-image-516". So you can write CSS for "img.wp-image-516" and set its float to left if you want to float it left from a specific width onwards.


    Genesis Tutorials | Follow me on Twitter

    October 17, 2014 at 6:54 pm #128212
    kridgroup
    Member

    Thanks!

    But it seems I am not getting the syntax right.

    My custom css now looks like this:

    #genesis-Footer {
    background-color: #ffffff;
    }

    .page-id-321 .entry-title, .page-id-298 .entry-title, .page-id-605 .entry-title, .page-id-603 .entry-title, .page-id-633 .entry-title, .page-id-632 .entry-title, .page-id-630 .entry-title, .page-id-635 .entry-title, .page-id-634 .entry-title, .page-id-618 .entry-title, .page-id-621 .entry-title, .page-id-615 .entry-title, .page-id-612 .entry-title, .page-id-651 .entry-title, .page-id-891 .entry-title {
    display: none;
    }


    @media
    only screen and (max-width: 629px) {
    .alignleft, .alignright {
    clear: both;
    float: none;
    display: block;
    }
    }


    @media
    only screen and (max-width: 320px) {
    .gallery-columns-3 .gallery-item {
    width: 100%;
    margin-bottom: 20px;
    }
    }

    I tried adding:


    @media
    only screen and (max-width: 629px) {
    img.wp-image-516 {
    float: left;
    }
    }

    But that does not change anything…

    Any advise?

    Thanks

    October 17, 2014 at 7:43 pm #128218
    Sridhar Katakam
    Participant

    I do not find that CSS on the site when inspecting with Firebug. Have you added it in child theme's style.css or in a custom.css?


    Genesis Tutorials | Follow me on Twitter

    October 17, 2014 at 7:58 pm #128219
    kridgroup
    Member

    Check style.css again now. i used the WordPress CSS editor before.

    October 17, 2014 at 8:11 pm #128220
    Sridhar Katakam
    Participant

    I searched for img.wp-image-516 in https://www.kridconsulting.com/wp-content/themes/executive-pro/style.css and do not find it.


    Genesis Tutorials | Follow me on Twitter

    October 17, 2014 at 8:24 pm #128221
    kridgroup
    Member

    You won't find it. I did not manage to get it work so i did not save it.
    What I tried is what you see above: Adding the following at the end of style.css:


    @media
    only screen and (max-width: 629px) {
    img.wp-image-516 {
    float: left;
    }
    }

    What I need to know is how to get the syntax right to get the image aligned left on small displays.

    October 19, 2014 at 4:35 pm #128351
    Sridhar Katakam
    Participant

    Adding

    @media only screen and (max-width: 629px) {
    
    	img.wp-image-516 {
    		float: left;
    		margin-left: 0;
    		margin-right: 10px;
    	}
    
    }

    at the end in style.css in Firebug does float the image to the left with text moving to its right.

    screenshot


    Genesis Tutorials | Follow me on Twitter

    October 21, 2014 at 8:03 pm #128704
    kridgroup
    Member

    Thanks a lot!

    Dirk

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 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

© 2026 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