How To Make The Menu Fit The Full Width Of The Screen In Twenty Seventeen

Posted on 27 December 2016 in Twenty Seventeen Theme Customisation
Comments: 21

The default Twenty Seventeen main navigation menu uses less than the full width of the screen and is the same width content area and sidebar, especially on a laptop or computer screen. The total width of the navigation menu can be made the full width of the screen.

The default width of the main navigation menu.

The main navigation menu made full width of the screen.

The full-width appearance should work throughout the site (e.g. single pages, single post & blog archives).

Where and how to make the menu width full screen:

In WordPress Admin > Appearance > Edit CSS.

Enter the CSS code below.

  • The two lines of code created the full-width effect for both mobile and computer screens.

The CSS code:

.navigation-top .wrap {
    max-width: 100%;
    /* padding: 0; */
}


@media screen and (min-width: 48em) {
.navigation-top .wrap {
    max-width: 100%;
    /* padding: 0.75em 3.4166666666667em; */
}
}
Share this:

Tags


Comment, ask or share something...

  1. Thanks a lot, I started using Twenty seventeen, I am not deep rooted to CSS, your customization code helped me a lot.
    Thanks again.

    Reply

  2. Hello Bharat

    I am using the "Advanced Twenty Seventeen Child" theme and your code doesn't seem to work for me :(
    My menu is still the same width as the content area and not 100%

    Any ideas as to what could be so different about the theme I'm using? I was the impression it's based on the same standard Twenty Seventeen theme with some minor additions to allow custom CSS etc and as such I would expect this to work for me.

    By the way my menu has eight menu items and two of the items are quite lenghty, and as such the last menu item wraps to a new line. I was actually looking for a way to shorten the gap between menu items in order to try to resolve this when I accidentally came across this article which would probably be even better if I can just manage to get it to work.

    Reply

      1. As you are using a different theme, without seeing the site and perhaps the admin, I would not know what to consider to help make the menu fit the width of the screen. Is there any way you can publish the site to view on the internet?

        Reply

        1. I figured it out, removed your /* padding: 0; */ comment which did the trick

          I then changed it to: padding-left: 20px; which works better for me.

          The Advanced Twenty Seventeen Child theme is in essence identical to Twenty Seventeen as far as I am aware so in theory everything you can do to one you should apply to the other.

          In any case thanks for you super quick response : )

          Hey another thing while I am here, I also have another CSS issue regarding increasing the width of particular sub-menus, but I don't if this is something I can post on your site.

          Reply

  3. In the code there is a final accolade } missing.
    The code should be:

    .navigation-top .wrap {
    max-width: 80%;
    /* padding: 0; */
    }

    @media screen and (min-width: 48em) {
    .navigation-top .wrap {
    max-width: 80%;
    /* padding: 0.75em 3.4166666666667em; */
    }
    }

    Very nice work otherwise. You've helped me a lot. I wanted to the content and menu to be wider, but not full screen, so replaced all the 100% entries with 80%. Worked perfectly :)

    Reply

      1. Thank you very much for your reply.
        I have used the following customizations

        /* To move menu to the right side of logo and aligned to it*/
        .navigation-top {
        left: 20%;
        position: absolute;
        top: 14px;
        width: 100%;
        background:#ffffff;
        height: 70px;
        }

        .site-navigation-fixed.navigation-top
        {
        position:relative;
        }

        Used code to increase the width to 100%
        Used code to hide Title.

        Can you please have a look at the website and let me know the code to decrease the gap between top menu and beginning of the page?
        goo.gl/b8tqXo

        Also please help me in removing the stickyness.
        Thank You

        Reply

          1. Thank you very much for the reply, But, I still want to remove the existing gap between header and the first image of the page. Is there a way? I wrote the following code to remove some gap.
            /* To reduce gap between Header and first image*/
            .panel-content .wrap {
            padding-bottom:0.5em;
            padding-top: 0.5em;
            }
            .site-branding {
            padding: 0em 0;
            }
            @media screen and (min-width: 30em)
            style.css:3192
            .site-branding {
            padding: 0em 0;
            }
            @media screen and (min-width: 48em)
            style.css:3192
            .site-branding {
            padding: 0em 0;
            }
            Using inspect element I found that the following code when altered can give the desired results.But I am unable to write it in css.

            element.style {
            margin-bottom: 70px;
            }
            Any suggestions? Thanks in advance

            Reply

                1. Hello,
                  It made a difference on your site with Firebug. Can use the 'Ask For Help' link on the top menu and send me your WordPress login and username so I can look into it directly on your site?
                  Thank you.

                  Reply

                    1. Thank you,
                      I have added the following CSS to your Custom CSS and it has reduced the space between the menu and page.
                      .site-branding {
                      margin-bottom: 0px !important;
                      }

                    2. Thank you very much. That was very kind of you.I had been struggling since two weeks. Thanks a zillion.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
Do NOT follow this link or you will be banned from the site!