Help with resizing header for tablet/mobile

Hello,

My header is not resizing well with different browser widths. How can I get my header to stop wrapping when using a smaller screen? I am not using the pro header tool.

Hi,

This particular situation is simply a matter of reworking your content to properly fit the physical limitations presented by the theme (this is a consideration that must be taken into account with all themes and designs). It is the same principle applied to filling up a room with furniture – there is only so much that can fit into a given space. The following should be considered in these situations:

Shorter Names – you should always shoot to have your top-level navigation links be as simple as possible. For example, if your link is “Learn About My Company,” Try using “About” instead. It conveys the same idea and will save you a ton of real estate.

Rearrange – sometimes we want to put all of our links in the top-level navigation, but not all pages are created equally. Pages of lesser importance that pertain to a parent link might work well as a sub-menu instead.

Less Links – even on more “complex” websites with lots of pages, there are always ways to combine information together to make things simpler, which also ensures that your user doesn’t have to click around for every granular piece of information. For example, you might have two top-level links called “About” and “Contact,” which could possibly be combined into one. This eliminates the need for extra links and makes things much simpler for your users to navigate. Less is more in information architecture.

Appearance – fortunately X features plenty of options for adjusting the appearance of elements throughout your site, and the navbar is one of the more flexible elements. Try using a smaller font size if possible to save on a little real estate.

Another option is to have your mobile button appear earlier.

You can add the code below in X > Launch > Options > CSS

@media (max-width: 1270px) {
body .x-nav-wrap.desktop {
    display:none;
}

body .x-btn-navbar {
    display:block;
    float:right;
}

body .x-nav-wrap.mobile {
    display:block;
}

body .x-nav-wrap.mobile.collapse {
  display:none;
}

body .x-nav-wrap.mobile.collapse.in {
    display:block !important;
}
}

Hope that helps.

I have reduced the spacing between the nav items, but when I do so it pushes them to the right instead of leaving them centered. I have tried changing the margin and centering to no avail. Can you help me center the links?

Nevermind. I figured it out. Thanks!

Glad to hear that. :slight_smile: