ie 10 div 对 hover的支持

来源:http://www.experts-exchange.com/Software/Internet_Email/Web_Browsers/Q_27288784.html

IE9 hover image not working for DIV

Asked by: WernerVonBraun Solved by: WernerVonBraun
We have the following

1) an HTML file
2) a CSS file
3) two image files, one blueish, one orangeish. See attached code.

Works in every browser except IE9

What on EARTH is going ON?

 
CSS:

div.menubutton
{
   background-image          : url('WebMenuWithBorderBG.png');
   height                    : 30px;
   width                     : 150px;
}

div.menubutton:hover
{
   background-image          : url('WebMenuWithBorderHoverBG.png');
   height                    : 30px;
   width                     : 150px;
}
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:

Select allOpen in new window

HTML:

<html>
<head>
  <link href="WTF.css" rel="stylesheet" type="text/css">
</head>
<body>

  <div id="M_Tasks" class="menubutton"></div>

</body>
</html>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Select allOpen in new window

Jump to Answer

ID: 27288784

Comments

Author Comment

by: WernerVonBraun on 2011-09-02 at 06:41:58ID: 36473332

Blue Image
  • Blue Image
Blue Image

Author Comment

by: WernerVonBraun on 2011-09-02 at 06:42:29ID: 36473334

Orange Image
  • Orange Image
Orange Image

Author Comment

by: WernerVonBraun on 2011-09-02 at 06:43:10ID: 36473338

  • 3 KB 
  • And the four all together in one handy ZIP
IE9Prob01.zip

Accepted Solution

by: WernerVonBraun on 2011-09-02 at 08:12:04ID: 36473916

Never mind, peeps. I found that adding a <!DOCTYPE tag to the top of the page solved the problem. It doesn't even matter which one you add; you could add this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
or this one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd">

It both works.

[shrug]

Author Closing Comment

by: WernerVonBraun on 2011-09-02 at 08:13:57ID: 36473930

There you have it folks. Zee internets exploder iz ebil

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值