Back in 2009 I wrote a page (http://www.ikriv.com/dev/dotnet/JavaClone/index.html) that contains a lot of fragments like this:
早在2009年,我写了一个页面(http://www.ikriv.com/dev/dotnet/JavaClone/index.html),其中包含很多这样的片段:
<sup><a href="#ref14">[14]</a></sup>
I think it looked fine back then in both Firefox and IE. To my astonishment, I found today that Firefox 14.0.1 shows some of them as expected, while some others are shown as if there were no sup
tag.
我觉得它在Firefox和IE中看起来都不错。令我惊讶的是,我今天发现Firefox 14.0.1按预期显示了其中的一些,而其他一些显示为好像没有sup标签。
The even funnier part is that IE8 has trouble at exactly the same places Firefox does, only instead of ignoring superscript it inserts an extra line break.
更有趣的部分是IE8在与Firefox完全相同的地方遇到麻烦,只是忽略了上标而是插入额外的换行符。
Chrome does the same thing as Firefox: some superscripts are fine while others are ignored.
Chrome与Firefox的功能相同:某些上标可以正常使用,而其他上标则被忽略。
I could not find any regularity in that, but three things are certain:
我找不到任何规律性,但有三件事是肯定的:
一些片段按预期显示,有些则不是
所有主流浏览器似乎在完全相同的地方都有问题
如果我删除标签,一切都恢复正常
What gives? Is putting <a> inside of <sup> illegal or something?
1 个解决方案
#1
5
The problem isn't with sup
embedded in a
, it's the a
tags with no inner text:
问题不在于嵌入在a中,它是没有内部文本的标签:
<a name="Interfaces" />
Inspecting this with Firebug shows that Chrome doesn't like this. It ignores the self-close and interprets everything after as being inside that a
tag.
使用Firebug进行检查表明Chrome不喜欢这样。它忽略了自我关闭并在标记内部解释了所有内容。
Change that like to:
改变喜欢:
<a name="Interfaces"></a>
and the problem with the superscript links corrects itself.
并且上标链接的问题纠正了自己。
#1
5
The problem isn't with sup
embedded in a
, it's the a
tags with no inner text:
问题不在于嵌入在a中,它是没有内部文本的标签:
<a name="Interfaces" />
Inspecting this with Firebug shows that Chrome doesn't like this. It ignores the self-close and interprets everything after as being inside that a
tag.
使用Firebug进行检查表明Chrome不喜欢这样。它忽略了自我关闭并在标记内部解释了所有内容。
Change that like to:
改变喜欢:
<a name="Interfaces"></a>
and the problem with the superscript links corrects itself.
并且上标链接的问题纠正了自己。