Site logo

Archived topic

Width of navigation when floating

5 replies · Started by Antwan on October 14, 2015

Viewing posts 1–6 of 6

Hi there!

I have set a logo and the navigation should float to the right of it. So far so good.
The navigation is a Max mega-menu with two nav-items, one aligned left and the other to the right. When placed under the logo/header, the width of the mega-menu is 100%, as desired. But when floated to the right of the logo, the width shrinks back to just the sum of the two nav-items. Is there a way this can be fixed, preferably so that the content that pops up upon nav hover uses the full 100% of the grid-container?

Thanks in advance!

Hi there,

Can you link me to your site?

Generally, HTML elements that float (left or right) will take on the width of their contents. This is because there's no way for the element to know how much room it has for the width between your logo and the edge of the container.

You could try something like this..

@media (min-width: 769px) {
    .nav-float-right .main-navigation {
        width: 80%;
    }
}

You may have to adjust the width using some other media queries at certain screen sizes, but that should get you on your way :)

Yep, that's it. Thanks for the pointer!

You're welcome :)

This archived topic is closed to new replies.