悬停CSS只能在Chrome中使用 [英] Hover CSS only working in Chrome

查看:137
本文介绍了悬停CSS只能在Chrome中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我想使用CSS悬浮类,它在Chrome上正常工作,但不是在Firefox。任何帮助赞赏。这是我的CSS:

Hey, I'm trying to use the CSS hover class and it works fine on Chrome but not on Firefox. Any help appreciated. Here's my CSS:

.albumbox .labeltext {
    visibility: hidden;
}

.albumbox:hover .labeltext {
    visibility: visible;
}

这里是相关的HTML:

And here's the relevant HTML:

<a href="http://open.spotify.com/album/2tG6kmDtT5rysmQAtzm5UW" target="_blank"><div class='albumbox'>

<img height="200px" width="200px" src="http://userserve-ak.last.fm/serve/300x300/9351489.jpg" />

<span class='album labeltext'>Escape The Fate<br>Escape The Fate</span>

</div></a>

如果您想查看整个页面,请在这里查看 http://fyspotify.appspot.com

If you want to see the whole page, check it out here http://fyspotify.appspot.com

感谢
Tom

Thanks Tom

推荐答案

最迫切的原因是您的网页正在 怪癖模式

The most pressing reason is that your page is rendering in Quirks Mode.

将此(HTML5 doctype)添加为第一行源代码,我相当肯定它会自动工作:

Add this (the HTML5 doctype) as the very first line in the source code, and I'm fairly sure it will automagically work:

<!DOCTYPE html>

这篇关于悬停CSS只能在Chrome中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆