我有一個爲所有表格單元格設置邊界的表格。這用於日曆。當前日期的表格單元格包含一個用於更改該表格單元格的背景顏色的div。但是,在Firefox中查看時,它會覆蓋(或覆蓋 - 我不確定)右側和底部表格單元格邊框。它覆蓋Opera中的頂部和左側表格單元格邊界。它在Chrome和Safari中運行良好。它沒有在IE中測試過。我怎樣才能讓所有的邊框在Firefox和Opera中顯示?下面是代碼:爲什麼Firefox不顯示錶格單元格邊界 - 右側還是左側?
HTML:
<table class="calendar" frame="box" rules="none">
<tr>
<td></td>...//seven td's total
</tr>
<tr><td class="very_light_gray"><div class="calendar_day_wrap">Today</div></td>...</tr>
.... // 5 or 6 table rows total
</table>
CSS:
.calendar {
position:inherit;
margin:auto;
height:100%;
width:100%;
z-index:99999;
border-collapse:collapse;
}
.calendar tr {
height:20%;
position:relative;
z-index:2;
}
.calendar td {
border:1px solid #ccc !important;
width:14%;
vertical-align: top;
position:relative;
z-index:2;
}
.calendar_day_wrap {
position:relative;
width:100%;
height:100%;
}
.very_light_gray {
background-color:#F8F8F8 !important;
}
如果我能看到改變背景顏色的代碼,我的回答能力會大大提高。另外,border-collaps:collapse;應該是「崩潰」。另外,爲什麼你有所有的Z指數的東西? – dezman
感謝您的回覆。我修正了上面的代碼,並添加了背景顏色的CSS。 Z-index的東西出於各種原因,但我改變它做不同的值,刪除它等,只是爲了看看它是否有效果。它沒有。 –