RSS

How to: Create a “Scroll to top” link

Wed, Jan 14, 2009

Ask Lucius, General, Internet Marketing

Dear Lucius

I see a lot of sites using the scroll top top link, It is very useful becasue when i’m done reading i hate to scroll all the way up there. How can I create one of those for myself on my blog?

Thanks
Sammy

————————

scroll upHello Sammy,

Im glad you brought this up. Its a pretty simple code you can add to your site or your blog.

First, open the header.php and verify that you have a <div id=”header”> somewhere. This should be the case on more than 95% of blogs anyways is you’re using wordpress.

If you dont see it or you want to add the “Back To Top” link on a static page simple add this link on code

<a name=”header”></a> on the top of that page.

Then

Open footer.php (or any other file) and insert the following code where you want your link to appear:

<a href=”#header”>Scroll To Top</a>

Its that simple. Now, your readers can easily scroll to top after reading a post.

——–

If you find this helpful please comment and if you have any question ask me here

http://smashingblog.com/ask-lucius

No TweetBacks yet. (Be the first to Tweet this post)

Post to Twitter Tweet This Post  Post to Digg Digg This Post  Post to Reddit Reddit  Post to StumbleUpon Stumble This Post

, , ,

This post was written by:

admin - who has written 98 posts on SmashingBlog.com.


Contact the author

Leave a Reply