0
我想把一個絕對定位的圖像內部的TD。以下代碼在FF 3.6中的圖像上方創建了不需要的間隙,並使圖像在IE 7中消失。我在表代碼之前包含了相關的外部樣式表元素。如何將絕對定位的img放入?
#leftColTopTdImg
{
padding:0px;
margin:0px;
position:relative;
}
#navLinksTD
{
position:relative;
padding:0px;
margin:0px;
}
#navLinksBoxDiv
{
position:relative;
width:100%;
height:100%;
padding:0px;
margin:0px;
}
#navLinksInBox
{
position:relative;
}
#navLinksBg
{
position:absolute;
width:100%;
height:100%;
}
<table width="222px" cellspacing="0px" cellpadding="0px" border="0px">
<tbody>
<tr>
<td id="leftColTopTdImg"><img width="222px" height="77px" alt="" src="../leftcol_top.jpg" /></td>
</tr>
<tr>
<td id="navLinksTD">
<div id="navLinksBoxDiv">
<img id="navLinksBg" src="../menu_combined_2r.jpg" alt="The background for the navigation link box. It has a vertical gradient going from light to dark and then dark to light blude" />
<ul id="navLinksInBox">
<li>
<a href="#">Driving While Intoxicated</a>
</li>
<li>
<a href="#">Sex Crimes</a>
</li>
<li>
<a href="#">2nd Driving While Intoxicated</a>
</li>
<li>
<a href="#">2nd Sex Crimes</a>
</li>
</ul>
<!--End of navLinksBoxDiv-->
</div>
<img id="menuBottom" src="../menu_bottomedge.jpg" alt="The bottom of the menu" />
<!--End of navLinksTD-->
</td>
</tr>
</tbody>
</table>
我對定位TD內的絕對格但同樣的伎倆,似乎並沒有在這種情況下工作了很多閱讀。我如何將絕對定位的img放在td中?謝謝。