2 Replies - 1394 Views - Last Post: 28 August 2012 - 08:01 AM

#1 clarissa_milner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-August 12

How do I insert a 'return to top' attribute?

Posted 28 August 2012 - 02:44 AM

How do I return to top using css? I have tried to use [a id="top"]return to top[/a] and it worked dine using html, but now does not work.
Is This A Good Question/Topic? 0
  • +

Replies To: How do I insert a 'return to top' attribute?

#2 Mina-no-Hime  Icon User is offline

  • D.I.C Head

Reputation: 98
  • View blog
  • Posts: 176
  • Joined: 23-August 12

Re: How do I insert a 'return to top' attribute?

Posted 28 August 2012 - 03:44 AM

You don't do it using CSS. CSS stands for Cascading StyleSheets - meaning it's intended for defining the appearance of elements on your web page.

To add a functional "go to top" link, you need to do the following:

1) At the start of your "top" (usually after your body tag), add an anchor tag with a 'name' attribute (I recommend "top").
2) Wherever you intend to place your "go to top" link, set its target URL to be a hash tag (#) followed by the value of the name attribute.

<a name="top" />
<!-- Rest of your code here... -->
<a href="#top">Go To Top</a>

Was This Post Helpful? 2
  • +
  • -

#3 clarissa_milner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-August 12

Re: How do I insert a 'return to top' attribute?

Posted 28 August 2012 - 08:01 AM

Thank you, that clears it up for me :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1