:悬停CSS不工作? [英] :hover CSS is not working?

查看:99
本文介绍了:悬停CSS不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个CSS类,如下所示:

I have created a CSS class as follows:

div.ycontent div.ppclisting { background-color:#cccccc; }
div.ycontent div.ppclisting:hover { background-color:#FFE5DF; }

我在我的网页,这是工作在Firefox,IE 7.0+相当精细之一,并在其他最新的浏览器应用上述风格。但是当我申请相同的风格在另一页则其无法正常工作。

I have applied the above style in one of my page, which is working quite fine in Firefox, IE 7.0+ and in other latest browsers. But When I am applying the same style in another page then its not working.

谁能告诉我可能是什么原因?为什么它不是在另一页的工作。

Can anyone tell me what could be the reason? why its not working in another page.

推荐答案

我为什么答案:悬停不另一页上工作。其实在第二页上在HTML页面中没有添加DOCTYPE标签下面,

I got the answer why the :hover was not working on another page. Actually on second page the DOCTYPE tag was not added in the HTML page as below,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

此前它是简单的&LT; HTML和GT; 标签,并且由于其中:悬停在股利不工作。如它的工作上面,我将DOCTYPE标记之后。

Earlier it was simple <html> tag and due to which :hover on the div was not working. After adding doctype tag as shown above its working for me.

感谢大家的帮助。

这篇关于:悬停CSS不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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