【发布时间】:2019-06-12 10:57:11
【问题描述】:
我在表格上设置:hover 属性以更改悬停时的行颜色。它在 CHROME 和 EDGE 上运行良好,但在 IE 11 上运行良好。
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
和
<meta http-equiv='X-UA-Compatible' content='IE=9; IE=10; IE=11;IE=8; IE=7; IE=EDGE'/>
CSS 部分:
tr.fullrow:hover{
background:yellow;
font-size:16px;
}
HTML 部分:
<table border = "1" class ="tablewip">
<caption> Assy WIP by Product </caption>
<thead>
<tr class ="headerrow">
<td class="headercells" font-size:100px; nowrap >'.$colHeader.'</td>
</tr>
</thead>
<tbody>
<tr class = "fullrow">
<td class = "wipcells" nowrap >Text </td>
</tr>
</tbody>
</table>
堆栈sn-p
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=9; IE=10; IE=11;IE=8; IE=7; IE=EDGE' />
<style>
tr.fullrow:hover {
background: yellow;
font-size: 16px;
}
</style>
</head>
<body>
<table border="1" class="tablewip">
<caption> Assy WIP by Product </caption>
<thead>
<tr class="headerrow">
<td class="headercells" font-size:100px; nowrap>'.$colHeader.'</td>
</tr>
</thead>
<tbody>
<tr class="fullrow">
<td class="wipcells" nowrap>Text </td>
</tr>
</tbody>
</table>
</body>
</html>
【问题讨论】:
-
悬停效果很好。但是,您的标记无效。注意内联样式应该放在
style属性中,nowrap应该是white-space: nowrap;。