Solved

IE9 hover image not working for DIV

Posted on 2011-09-02
5
1,422 Views
Last Modified: 2013-12-08
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;
}

Open 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>

Open in new window

0
Comment
Question by:WernerVonBraun
  • 5
5 Comments
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 36473332
Blue Image Blue Image
0
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 36473334
Orange Image Orange Image
0
 
LVL 4

Author Comment

by:WernerVonBraun
ID: 36473338
0
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
ID: 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]
0
 
LVL 4

Author Closing Comment

by:WernerVonBraun
ID: 36473930
There you have it folks. Zee internets exploder iz ebil
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem I downloaded the Microsoft Internet Explorer 9 Beta, today, to give it a test drive and maybe write a review for the site, and it failed miserably and got stuck in a crash restart loop. The error message given is as illustrated below i…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now