2016-10-28 54 views
0

我試過幾個選項來做到這一點,但都沒有工作。試圖刪除圖像周圍的填充物並收緊桌子。我認爲必須有一些我可以使用的內聯風格,但是我太過分了解這一點。任何幫助將不勝感激。覆蓋CSS表格樣式來刪除填充

這是從photoshop生成的html。

<table id="Table_01" class=" alignleft" style="height: 291px" border="0" width="570" cellspacing="0" cellpadding="0"> 
<tbody> 
<tr> 
<td colspan="2"><a href="http://www.boem.gov/"> <img src="http://oceanleadership.org/wp-content/uploads/BOEM-Logo.jpg" alt="http://www.boem.gov/" width="297" height="115" border="0" /></a></td> 
<td colspan="2"><a href="http://www.jasco.com/"> <img src="http://oceanleadership.org/wp-content/uploads/JASCO-Logo.jpg" alt="http://www.jasco.com/" width="273" height="115" border="0" /></a></td> 
</tr> 
<tr> 
<td><a href="https://www.csaocean.com/"> <img src="http://oceanleadership.org/wp-content/uploads/CSA-Ocean-Sciences-Inc.-Logo.jpg" alt="https://www.csaocean.com/" width="152" height="96" border="0" /></a></td> 
<td><a href="http://www.ifaw.org/united-states"> <img src="http://oceanleadership.org/wp-content/uploads/IFAW-Logo.jpg" alt="http://www.ifaw.org/united-states" width="145" height="96" border="0" /></a></td> 
<td><a href="http://www.mbari.org/"> <img src="http://oceanleadership.org/wp-content/uploads/MBARI-Logo.jpg" alt="http://www.mbari.org/" width="125" height="96" border="0" /></a></td> 
<td><a href="https://schmidtocean.org/"> <img src="http://oceanleadership.org/wp-content/uploads/Schmidt-Ocean-Institute-Logo.jpg" alt="https://schmidtocean.org/" width="148" height="96" border="0" /></a></td> 
</tr> 
<tr> 
<td><a href="http://www.teledynemarine.com/SitePages/HomePage.aspx"> <img src="http://oceanleadership.org/wp-content/uploads/Teledyne-Marine-Logo.jpg" alt="http://www.teledynemarine.com/SitePages/HomePage.aspx" width="152" height="80" border="0" /></a></td> 
<td><a href="http://oceansonics.com/"> <img src="http://oceanleadership.org/wp-content/uploads/Ocean-Sonics-Logo.png" alt="http://oceansonics.com/" width="145" height="80" border="0" /></a></td> 
<td><a href="http://www.l-3mps.com/maripro/"> <img src="http://oceanleadership.org/wp-content/uploads/L3-Maripro-Logo.jpg" alt="http://www.l-3mps.com/maripro/" width="125" height="80" border="0" /></a></td> 
<td><a href="https://sea-birdscientific.com/"> <img src="http://oceanleadership.org/wp-content/uploads/Sea-Bird-Scientific-Logo.png" alt="https://sea-birdscientific.com/" width="148" height="80" border="0" /></a></td> 
</tr> 
</tbody> 
</table> 
<br /> 
+1

沒有填充,其圖像的實際'width'和'height'其中有大約產生 – Rohit

+0

_Photoshop_空白那?這是非常殘酷的。表格上的'border = width = cellspacing = cellpadding ='已過時;與**'img' **標籤上的'width = height = border ='相同......所有這些事情現在都應該在CSS中完成。 –

回答

0

使用內聯樣式是不是一個好主意,但包括屬性風格=「填充:0像素,保證金:0像素」內嵌在你的img標籤將確保瀏覽器未渲染任何周圍多餘的空間圖像本身。更好的選擇是包含一個.css文件和規則: td img padding:0px; margin:0px }

該規則應自動將樣式分配給表格中的所有img標籤。

0

它與圖像的問題我刪除了你的風格,因爲你的圖像仍然有它的空白。 你可以看到下面 代碼 <table id="Table_01" class=" alignleft" style="height: 291px" border="0" width="570" cellspacing="0" cellpadding="0">

我刪除了這種風格,在這裏試圖 Demo