• 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

Responsive Design – How to center a div on small resolutions

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 › Responsive Design – How to center a div on small resolutions

This topic is: resolved

Tagged: css media-queries responsive design

  • This topic has 3 replies, 2 voices, and was last updated 12 years, 6 months ago by MrNerdy.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • February 7, 2014 at 7:22 am #89113
    MrNerdy
    Member

    I am using the Genesis starter theme and placed the 'Simple Social Icons'-plugin in my right header widget area.
    Within the menu you can select the alignment of the icons (left, right, center).

    While I want the icons to right align on large resolutions, I would like them to center on resolutions widths of less than 767px; i. e. I placed the following code in my style css in order to override the alignright-class:

    @media only screen and (max-width: 767px) {
    
    	.simple-social-icons .alignright {
    		text-align: center;
    		float: none;
      		margin-left: auto;
      		margin-right: auto;
    		display: inline-block;
    	} 

    Unfortunatley, this does not work. The alignright-class is still applied: .alignright { float: right; text-align: right; }.

    I am coming from a Bootstrap-background, where I am used to hardcode my CSS / HTML working with the responsive classes of the framework, which is honestly so much more flexible than WordPress.

    Is there a tutorial / article that explains how to work and modify the responsive classes in Genesis, e.g. how to make divs invisibile on small resolutions, how to implement a Bootstrap-style menu?

    Would be great if you could advice me how to get this done.

    Thanks a lot for your help.

    February 7, 2014 at 10:59 am #89146
    ramseyp
    Member

    It sounds like your CSS isn't specific enough, if the .alignright rules are still in effect. Can you change up the selectors so the specificity increases?


    Community • Work • Conversations

    February 7, 2014 at 11:04 am #89148
    MrNerdy
    Member

    Hi, thanks for your reply.

    I just realized that the CSS of the plugin (Simple Social Icons) is constantly overwriting my child theme's style.css. I already tried to center the icons within the plugin menu and then apply the following code for higher resolution media queries; however, wihtout success:

    .simple-social-icons ul.aligncenter {
    		text-align: right !important; 
    	}
    
    	.simple-social-icons ul.aligncenter li {
    		display: inline-block !important;
    		float: right !important;
    	}

    Any idea how to make sure that the plugin's CSS-styles are overwritten?

    February 7, 2014 at 11:23 am #89151
    MrNerdy
    Member

    Just found a working solutions:

    @media only screen and (min-width : 768px) and (max-width : 2560px)  {
    
    .simple-social-icons ul.aligncenter {
    		text-align: right !important; 
    	}
    
    }
  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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