I'm currently working with this code snippet:
#main {
max-width: 500px;
height: 900px;
margin: auto;
background: green
}
.menu1 {
height: 30px;
background: red
}
.menu2 {
display: none;
}
<div id="main">
<div class="menu1">COntent 1</div>
<div class="menu2">Content 2</div>
</div>
My query is regarding how to make the .menu2
div stay fixed at the top when scrolling down using CSS.
.menu2 {
height: 30px;
background: blue;
position: fixed;
}
Here is the link to my current code implementation: http://jsfiddle.net/rh1aLnxs/
Any help on this matter would be greatly appreciated. Thank you!