• 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

Proper Way To Center Navigation

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 › Proper Way To Center Navigation

This topic is: not resolved

Tagged: fixed, navigation, responsive, size, Width

  • This topic has 3 replies, 2 voices, and was last updated 9 years, 1 month ago by Porter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 5, 2014 at 8:25 pm #117233
    Porter
    Participant

    I altered the sample theme navigation to be a fixed size of 1200px, rather than the full width spanning the entire page design it has by default. It's the right size, and centered on a desktop, but on mobile, the page scrolls to the left a ton, and the navigation text is centered according to that width.

    My current code:

    .nav-primary {
    	background-color: #202020;
    	width: 1200px;
    	margin: 0px auto;
    }

    Those are the only changes I made, as it's fine on desktop. How do I go about properly changing the menu to the same width as the rest of the site (in my case 1200), and keep the navigation responsive?


    Buy me a beer? | Try DigitalOcean VPS Hosting

    http://anightinburlington.com/
    August 5, 2014 at 8:31 pm #117235
    ᴅᴀᴠɪᴅ
    Member

    Delete the line

    width: 1200px

    replace withmax-width: 1200px;

    Or.. if you need it to never go to the edges.. you would have to add the same css to .nav-primary which is already on .site-inner .wrap, so find..

    .site-inner, .wrap {
        max-width: 960px;
    }

    in the media queries and replace with..

    .site-inner, .wrap,
    .nav-primary  {
        max-width: 960px;
    }

    and do the same anywhere else in the media queries that targets the wrap.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    August 5, 2014 at 8:32 pm #117236
    ᴅᴀᴠɪᴅ
    Member

    First way is easier, if you're not sure. Just use your code, but replace that one line.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    August 6, 2014 at 7:39 am #117334
    Porter
    Participant

    So if I understand, I'm just adding .nav-primary to the already existing .site-inner and wrap media queries? I went ahead and did that, and it appears to be working great on a Kindle Fire HD. I'll test it on the nook color and apply it to the other media queries to see the effects.


    Buy me a beer? | Try DigitalOcean VPS Hosting

  • 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

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