Register now or log in to join your professional community.
This can be don with switching to position: fixed.
For example a div with the class
#fixed-div {
position: fixed;
top:0;
left:0;
right:0;
height:100px;
background-color: #000;
}
will remain fixed in the upmost100px of your browser viewport when you're scrolling.
This fiddle demonstrates the effect in both vertical and horizontal direction
Hope this helps
You can see a demo on the following website.
http://jsfiddle.net/ukzYf/1/