We help IT Professionals succeed at work.

how to keep a div at a fixed position when scrolling

eMisc
eMisc asked
on
822 Views
Last Modified: 2012-05-10
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
Comment
Watch Question

Commented:
In css file:

#divname{position:fixed;margin:0;top:0;}
Luis PĂ©rezSoftware Architect in .Net
CERTIFIED EXPERT

Commented:
Take a look at this:

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

Hope that helps.

Author

Commented:
none of them works on iphone safari
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.