• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Floating back to top button?

Fredie

No.
Hi, I'm wondering if anyone knows how to do a floating "back to top" button? I want it to scroll with the user so they can click it at any point in the page.

Thanks.
 
Just use position:fixed in the css for whichever element you want to stay in place, then put an anchor link to the top in it.
 
Of course, thanks. Do you know how I'd make it stay in the bottom right?

EDIT: Could I just do..?
Code:
position: bottom right;
 
Last edited:
No. You'd have to use position:fixed; bottom:0; right:0;

Though I should warn you that Internet Explorer 6, still used by an unfortunate 17% or so of Internet users, doesn't support position:fixed. You can just decide to ignore them (and probably put the link somewhere in the document flow where it will still be potentially useful to IE6 users, like at the bottom), but if you want it to work for everyone, you'll want to either exploit the bug that lets you use position:absolute as if it were position:fixed in IE or IE-expressions.
 
Oh, okay then. Thank you very much.

At the moment no one who has visited my site has been using IE6.. but I shall look at those anyway, thanks again.
 
Back
Top Bottom