0
how to make an element to be always on top? (z-index?)
how do you do it in elements/layouts such as navigation bar on top?
1 Resposta
+ 1
Hmm, it depends on what exactly you want to do. If you want to have a nav-bar on the top that stays there even when you scroll down, you'll want `position: fixed;`. Check out this example:
<style>
*{margin: 0; padding: 0;}
nav{
width: 100vw;
height: 100px;
background: brown;
position: fixed;
top: 0;
left: 0
}
div{
height: 2000px;
}
</style>
<nav></nav>
<div></div>