Skip to content

CSS Customization - Top Bar sticky

1 minute read

By default it is not possible to have sticky top bar, hovewer you can overwalk it via custom CSS code

@media (min-width:1023px) {

body:not(.admin-bar) .mh-fixed-menu {

position: fixed!important;

width: 100%!important;

z-index: 999!important;

top: 36px!important;

}

body:not(.admin-bar) .mh-top-header {

position: fixed!important;

width: 100%!important;

top:0!important;

z-index:999999999!important;

}

body:not(.admin-bar) .mh-fixed-menu--active #mega_main_menu {

margin-top: 36px!important;

}

}

How it will works?

  • Only for user who do not see "black admin bar" (e.g. admin will not see it, to test try incognito mode)
  • Only for desktop
  • number 36px in the code - is top bar height

In this article you can find information how to add custom CSS to any WordPress Theme:

Ask the people who build MyHome WPBakery

We answer by email from support@tangiblewp.com. With Premium Support, we also fix your site when something breaks.

Was this guide helpful?