I am trying to fix a div so it always sticks to the top of the screen, using:
div
position: fixed; top: 0px; right: 0px;
However,
When you use position:fixed CSS rule and try to apply top/left/right/bottom it position the element relative to window.
position:fixed
top
left
right
bottom
A workaround is to use margin properties instead of top/left/right/bottom
margin