简体   繁体   English

基本HTML内部链接在IE8中不起作用

[英]Basic HTML Internal Link not working in IE8

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! 这在所有工作正常的IE8(实际上是IE8-而不是IE8模式下的IE9)上的所有浏览器中都可以正常运行,但不能正常工作!

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; 我尝试用&nbsp;填充“顶部”锚点 but that hasn't changed it. 但这并没有改变。 Any ideas? 有任何想法吗?

Actual use case: http://databizsolutions.ie/contents/page.php?v=35&u=admin-videos 实际使用案例: http : //databizsolutions.ie/contents/page.php?v=35&u=admin-videos

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>  

Two things: 两件事情:

  1. Using <a name="..."> is as old as last millenium. 使用<a name="...">与上一千年一样古老。 Use an id attribute on an existing element. 在现有元素上使用id属性。 Preferably the exact one you are targeting. 最好是您要定位的确切对象。 Then you can do cool stuff with the :target CSS selector. 然后,您可以使用:target CSS选择器来做一些很酷的事情。
  2. Do not include the full filename when you just want to change the hash. 当您只想更改哈希值时,请勿包括完整文件名。 Just <a href="#top"> works perfectly fine. 只是<a href="#top">可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM