我无法在IE浏览器中覆盖表格,FF和Chrome工作正常
尝试了所有我知道如何使用jsfiddle的CSS,并且不能让IE看起来像FF和Chrome,任何建议?我根本无法更改HTML,所以我要离开CSS试图获取此内容
<table class="report">
<caption>
</caption>
<tbody>
<tr>
<th></th>
<th></th>
</tr>
</tbody>
</table>
答案 0 :(得分:1)
下面:
小提琴:http://jsfiddle.net/pn2Th/
我在标题中添加了position:relative;
:
.report {
width:200px;
height:50px;
border:2px solid green;
background:pink;
}
.report caption { //I also changed this, comes in handy if you have more than one table with caption, because now these rules only apply to the caption of tables with class 'report'
position:relative; //I added this
width:196px; //I also changed this, to align the caption's width with the table's in IE (in Chrome the table was actually 204px wide before)
height:50px;
border:2px solid red;
background:black;
margin-bottom:-2px;
}
我认为有必要将z-index:0;
添加到.report
(或者甚至是.report tbody
),
和z-index:1;
到caption
...
但似乎没有必要这样做。
答案 1 :(得分:1)
<table class="report">
<caption>
</caption>
<tbody>
<tr>
<th></th>
<th></th>
</tr>
</tbody>
<div class="overlay"></div>
</table>