Navbar Fixed Top After Scrolling Code Example


Example 1: stick menu bar in css


.navigation {
/* fixed keyword is fine too */
position: sticky;
top: 0;
z-index: 100;
/* z-index works pretty much like a layer:
the higher the z-index value, the greater
it will allow the navigation tag to stay on top
of other tags */

}

Example 2: css sticky navigatiojn


nav {
position:sticky;
top:0;
}

/*Top can be replaced with bottom, left, or right
depending on what you want :) */

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable