# Div Sticks to top of browser on scroll?

**URL:** <https://forum.kirupa.com/t/div-sticks-to-top-of-browser-on-scroll/326565>\
**Category:** web dev\
**Created:** [December 24, 2011, 3:46pm UTC](https://forum.kirupa.com/t/div-sticks-to-top-of-browser-on-scroll/326565 "2011-12-24T15:46:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodman650](https://avatars.discourse-cdn.com/v4/letter/w/b9bd4f/32.png) [@woodman650](https://forum.kirupa.com/u/woodman650)\
**Post date:** [December 24, 2011, 3:46pm UTC](https://forum.kirupa.com/t/div-sticks-to-top-of-browser-on-scroll/326565/1 "2011-12-24T15:46:23Z")

</div>

Hi all (Happy Holidays!),

I’m interested in making a div element “stop” along the top of a browser window when a user scrolls down on the page and pop back into it’s original placement when they scroll back up… please see [cnet.com](http://www.cnet.com) and their “Top Categories” section on the left for reference. I have a feeling this is a relatively straight forward function but I’m not sure what to search for on the web and my few attempts to break out the code from the cnet page has caused the function to break (the div starts and stays aligned to the top of the browser at all times).

Any insights or ideas would be greatly appreciated. Thanks!
