需要在表格上加上字幕覆盖

时间:2014-06-11 02:41:04

标签: css css3 internet-explorer

我无法在IE浏览器中覆盖表格,FF和Chrome工作正常

尝试了所有我知道如何使用jsfiddle的CSS,并且不能让IE看起来像FF和Chrome,任何建议?我根本无法更改HTML,所以我要离开CSS试图获取此内容

http://jsfiddle.net/6V2Qf/74/

<table class="report">
    <caption>
    </caption>
    <tbody>
        <tr>
            <th></th>
            <th></th>
        </tr>
</tbody>
</table>

2 个答案:

答案 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>

http://jsfiddle.net/kisspa/6V2Qf/75/