Solved Templates

how to make a menu sticky

Asked by University of Mauritius 3 years ago Last activity 3 years ago

hello,

I wish to make the menu sticky so that it is always present even if we scroll the page down.
Kindly advise.

Thanks & Rgrds,
Prashant

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff

you're welcome.

Mark as solved, thx

5 more replies

Paul Frankowski Senior Staff

Hi,

in that template by default only header (sp-header) is sticky, not menu.

So it request extra changes to correct that.

What is your piority header with logo or menu?? or both?

Paul Frankowski Senior Staff
3 years ago · edited

If you want to show both, please use following custom CSS


@media (min-width: 999px) {
#sp-main-menu {
  position: fixed;
  display: block;
  width: 100%;
  top: 100px;
  z-index: 999; }

#sp-main-body {
  margin-top: 70px; }
    }

it will work for desktop only.

University of Mauritius Asked this

it would be great to have both. If not possible, then I believe the menu is more important to be sticky

Paul Frankowski Senior Staff

use above

University of Mauritius Asked this

That's perfect!! thank you for your usual cooperation.

TC

Log in to reply.