
09-02-2009
|
|
|
|
IE8: problem with tr:hover
On a web page I have implemented a context menu. I build it using a table,
and each row is a menu item.
Using a stylesheet the menu items change color when the mouse hovers them.
The stylesheet looks like this:
table.ContextMenu tbody tr:hover td
{
color: white;
background: #316AC5;
}
This is working fine in IE7 and firefox, but it does not work in IE8 unless
changing to compability view.
Shouldn't this work in IE8, or am I doing something wrong?
When doctype is set to: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
the first row the mouse hover changes color, but not hovering following rows.
If I change doctype to: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> it only
works in firefox, but not IE at all.
So far I'm forcing compability view using: <meta
http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> but I don't think
that's a solution, unless it turns out to be a bug in IE8.
TIA,
Jan
|