Basic HTML Internal Link not working in IE8

2.1k Views Asked by At

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

2

There are 2 best solutions below

4
On

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>  
5
On

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.