How to keep a div stuck in the same spot while the rest of page is scrolled?
example: http://www.ehow.com/how_2196172_ping-mac-co开发者_运维问答mputer.html
As you can see the "helpful?" element is stuck in place even when you scroll the rest of the page. I'm not sure if this can be done with just css or needs js (preferably jQuery). How can this be done?
You have to fix the element position. Try something like this:
div#ID { position: fixed; bottom:10px; left:10px; }
Hope it helps!
That is using position: fixed
which positions an element with respect to the browser view port.
精彩评论