简体   繁体   中英

How to keep my top menu stay fixed when i scroll

My Website : http://calisyo.com/product-category/?product=?/jacket-2-poche/

i have problem with my menu when i scrool hes scroll also

in this page I want the top menu to stay on the top of the page when a user/member scrolls.

so looking at your site, when I played around in the Dev tools if i commented out the "banner--stick" css it stayed at the top the whole time. I would only use the position fixed and try not to mess with JS to change the css class you the page is scrolled

use below css

  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  margin-top: 0;

Try adding this CSS rule:

header#masthead.banner--stick {
    margin-top: 0;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM