How to fix navigation bar in wordpress?

Poriya

New Member
#1
I am working on a theme which has a dynamic menu when we scroll it goes hide. I want to fix it on the top just like w3school website. Any idea? Is it a good option to use a plugin like Sticky menu
Here is the website link https://spaceunlimited.in/

CSS
Mã:
 .ehf-header #masthead {
    z-index: 30;
    position: relative;
}
 

Admin

Administrator
Thành viên BQT
#2
When using the following for masthead you can keep the brown borders on the side.
Mã:
#masthead {
    z-index: 30;
    position: fixed;
    background: whitesmoke;
    top: 0;
    left: 20px;
    max-width: calc(100% - 40px);
}
 
Top