One of the most common headaches when making CSS for mobile, is the inconsistent, buggy and awful implementation of
There's a lot of resources explaining this, so I'll just throw a bunch of links instead of writing a new post about it.
The problem (iOS)
The problem (cross device)
How it should behave
...and it does on modern mobile browsers:
Just CSS, no JS fixes applied.
position:fixed test page
I think quite all alternatives are explained on Brad Frost's post, so I'll link again to it: