how to keep a div at a fixed position when scrolling

Hello,
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
eMiscAsked:
Who is Participating?
 
eMiscConnect With a Mentor Author Commented:
0
 
BaxtaCommented:
In css file:

#divname{position:fixed;margin:0;top:0;}
0
 
Luis PérezSoftware Architect in .NetCommented:
Take a look at this:

http://www.dynamicdrive.com/dynamicindex17/stayontop.htm

Hope that helps.
0
 
eMiscAuthor Commented:
none of them works on iphone safari
0
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.