简体   繁体   English

IE如何与无内容的锚标记一起使用?

[英]How does IE work with contentless anchor tags?

I am trying to do a hover over effect on an image on a site that I am working on. 我试图将鼠标悬停在我正在处理的站点上的图像上。 I am having two problems with this. 我对此有两个问题。 The first is browser specific and is my main worry. 首先是特定于浏览器的,这是我的主要担心。

Anchor tag problem: 锚标签问题:

When I view the site on Chrome, Safari and Firefox the tooltip ( Jquery tools ) works as expected. 当我在Chrome,Safari和Firefox上查看网站时,工具提示( Jquery tools )会按预期工作。 When viewed IE, the hover over is really strange. 当查看IE时,悬停确实很奇怪。 It seems as though the hover only is recognized when your mouse is over the outermost row of pixels (the border) on the anchor tag. 似乎只有当鼠标位于锚点标签上最外面的像素行(边框)上时,才可以识别悬停。 The result is not being able to view the tool tip while in Internet Explorer. 结果是在Internet Explorer中无法查看工具提示。 I have tried doing this in ways other than with Jquery tools, but even with the HTML event "onmouseover", the same effect happens. 我尝试用Jquery工具以外的方法执行此操作,但是即使使用HTML事件“ onmouseover”,也会发生相同的效果。

I tried a few things while experimenting with this, and it seems that if I put something inside the anchor tag like some text, the text expands the hoverable area. 在尝试进行此操作时,我尝试了一些尝试,似乎如果将某些文本之类的内容放入锚标记中,则文本会扩展可悬停区域。 This is interesting because this only happens in internet explorer. 这很有趣,因为这仅发生在Internet Explorer中。

For my environment, I am running on a 27" monitor with the latest Chrome, Firefox, Safari, and Internet Explorer 8 to test for compatibility. 对于我的环境,我正在27英寸显示器上运行,并使用最新的Chrome,Firefox,Safari和Internet Explorer 8进行兼容性测试。

Second z-index problem: 第二个z-index问题:

The second problem I am having is with the tooltip. 我遇到的第二个问题是工具提示。 It seems as though the tooltip, although styled with the highest z-index, goes behind an image of a school that I have infront of it. 似乎工具提示虽然具有最高的z-index样式,但似乎落后于我眼前一所学校的形象。 I figured that one of you might have a clue on what is going on with that, because I am stumped. 我想你们当中的一个可能对这件事有一个线索,因为我很沮丧。

View the site 查看网站

I put the site up and minimized it on jsfiddle.com. 我在jsfiddle.com上建立了网站并将其最小化。 Here is the link to the project that I posted. 这是我发布的项目的链接。

http://jsfiddle.net/keirp/B9Cgc/ http://jsfiddle.net/keirp/B9Cgc/

Give your <a> some dimensions and/or display block or inline block. 给您的<a>一些尺寸和/或显示块或嵌入式块。 IE has trouble getting position for <a> when they are inline with nothing in them 当它们内联时,IE无法获得<a>位置

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

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