how to keep a div at a fixed position when scrolling

I need a div fixed on top of the screen, so when you scroll the page that div remains always visible at the top over the rest

I need it working on iPhone Safari, html, css and javascript are ok, imagine it just like a banner always visible

thank you
Who is Participating?
eMiscConnect With a Mentor Author Commented:
In css file:

Luis PérezSoftware Architect in .NetCommented:
Take a look at this:

Hope that helps.
eMiscAuthor Commented:
none of them works on iphone safari
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.