Html IE和Firefox中的活动和悬停状态问题
我有一个css触发的覆盖问题。这个解决方案在Chrome上运行得不错,但在Firefox上有一些小问题,在InternetExplorer中完全无法使用 在Firefox中,问题在于:active。我必须按住鼠标按钮1-2使覆盖层停留,而在IE中它根本不显示 因此,我的HTML标记是:Html IE和Firefox中的活动和悬停状态问题,html,css,internet-explorer,firefox,Html,Css,Internet Explorer,Firefox,我有一个css触发的覆盖问题。这个解决方案在Chrome上运行得不错,但在Firefox上有一些小问题,在InternetExplorer中完全无法使用 在Firefox中,问题在于:active。我必须按住鼠标按钮1-2使覆盖层停留,而在IE中它根本不显示 因此,我的HTML标记是: <a href="#" id="aftermath" title="Mark Nielsen's 3D computer animation project devekoped at Aalborg Med
<a href="#" id="aftermath" title="Mark Nielsen's 3D computer animation project devekoped at Aalborg Media College">
<article class="three columns">
<h1>
Aftermath
</h1>
<img src="images/aftermath-video.jpg" class="resize" alt="3D computer animation project by Mark Nielsen" />
</article>
</a>
<div class="infobox" id="aftermathinfo">
<article>
<h1>
Aftermath
</h1>
<p class="truncate">This was the result of the "free project" from my stay at Media College Aalborg. Sebastian Baasch and I modelled this from a picture of an old army Jeep and did everything else ourselves. Besides modelling the Jeep and various objects in the landscape I also did all 2D graphics, editing and post effects.</p>
<p><a href="posts/aftermath-video.aspx" class="important-link" title="Mark Nielsen's 3D computer animation project devekoped at Aalborg Media College">See and read about the computer animation project here</a></p>
<p> </p>
<p> </p>
<p><a href="portfolio.aspx" title="Go look at Mark Nielsen's projects, including web page design, graphic design, programming and much more...">Close this window</a></p>
</article>
</div>
可以在这里看到实时版本:我怀疑这种行为并没有很好地定义,您正在与浏览器的事件顺序进行斗争。(在关闭覆盖时,也会强制重新加载整个页面,这是次优的。) 尝试使用
:target
;仅当片段(URL栏中的#foo
是元素的id时,它才匹配该元素。您所要做的就是将链接更改为
(无论如何比#
好得多),并将最后一个选择器更改为\aftermathinfo:target
。“关闭”链接可以直接链接到#
,这将清除片段并禁用:target
不知道它在IE中的效果如何,唉。可能只有9+。我知道你在使用HTML5标记,所以希望旧的IE不是问题。我看不到任何关于
:active
伪元素的规则。@matewka是最后一个。不要使用active状态使这些元素可见活动状态只是在按下按钮和释放按钮之间的瞬间。@Danko是的,想法是在mousedown上,在mouseupI终于有时间尝试之前,visible会激活,覆盖层的悬停会接管。到目前为止,它工作得很好。我不知道:塔吉特,那会在将来帮助我。非常感谢你!