1

This one has me scratching my head. I have a page with several internal links bringing the user down the page to further content. Beneath various sections there are further internal links bringing the user back to the top. This works fine in all browsers apart from IE8 (actual IE8 - not IE9 in IE8 mode) where they work go down, but not coming back up!

Examples:

<a href="page.php?v=35&amp;u=admin-videos#a">A &ndash; General</a>
.... //travelling DOWN the page
<h3><strong>A &ndash; General<a name="a"></a></strong></h3>

<a name="top"></a>
.... //travelling back up
<a href="page.php?v=35&amp;u=admin-videos#top">Back to top.</a>

I've tried filling the 'top' anchor with &nbsp; but that hasn't changed it. Any ideas?

Actual use case: http://databizsolutions.ie/contents/page.php?v=35&u=admin-videos

Eamonn
  • 1,338
  • 2
  • 21
  • 53

2 Answers2

1

Try to give it like

<a href="#top">Back to top.</a>

put it like this, I hope it will work

   <a name="top">Title Text here</a>  
    <a href="#top">go to top</a>  
Adil
  • 146,340
  • 25
  • 209
  • 204
  • Tried it, but it needs the query string to stay on the page. – Eamonn Apr 14 '12 at 11:18
  • Do not give whole page path as you do not need to go to server you just want to jump to top of page (just scroll up) – Adil Apr 14 '12 at 11:26
  • leaving out the path results in a link pointing to http://databizsolutions.ie/contents#top which kicks me back to the index page. I've edited the usecase to display this – Eamonn Apr 14 '12 at 11:39
  • 1
    There is an editable example over here http://www.ezineasp.net/Samples/HTML/HTML-Basics/HTML-Hyperlink-Bookmark-Tag/Default.aspx – Adil Apr 14 '12 at 11:52
0

Two things:

  1. Using <a name="..."> is as old as last millenium. Use an id attribute on an existing element. Preferably the exact one you are targeting. Then you can do cool stuff with the :target CSS selector.
  2. Do not include the full filename when you just want to change the hash. Just <a href="#top"> works perfectly fine.
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592