我正在处理别人编写的某些代码,并且我需要更改一个3块元素。
我正在尝试将第一个块的高度更改为仅与图像一样大。
我找不到控制块高的任何方法,也无法弄清楚是什么设置了高度。
如果您有任何建议,请提供帮助。
谢谢!
<!--[if mso]><table border="0" cellpadding="0" cellspacing="0" align="left" style="mso-table-lspace:0pt; mso-table-rspace:0pt; border-collapse: collapse; width: 100%"><tr><td style="width: 100%;"><![endif]-->
<div style="float: left; width: 100%" class="sapMktBlock">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="min-width:100%;" bgcolor="#FFFFFF">
<tbody>
<tr>
<td style="font-size:0px" class="nomob"> </td>
<td width="640" align="center" style="width:640px;min-width:640px;" class="wrapto320px">
<table role="presentation" width="100%" border="0" cellspacing="0" cellpadding="0" style="min-width:100%; " class="wrapto320px">
<tbody>
<tr>
<td align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th bgcolor="red" class="colsplit" style="width:213px;vertical-align: top;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 0px 0px 0px;">
<a href=""><img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1976" width="213" height="auto" style="display:block;height:auto;" class="nomob" alt="1976"></a>
<div style="width:0; overflow:hidden; float:left; display:none; max-height:0px; mso-hide:all;" class="show">
<a href=""> <img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1976mob" width="1" style="display:block;" class="wrapto100pc" alt="1976"> </a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 20px 10px 20px;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</th>
<th bgcolor="#f8f3e8" class="colsplit" style="width:213px;vertical-align: top;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 0px 0px 0px;">
<a href=""><img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1996" width="213" height="auto" style="display:block;height:auto;" class="nomob" alt="1996"></a>
<div style="width:0; overflow:hidden; float:left; display:none; max-height:0px; mso-hide:all;" class="show">
<a href=""> <img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1996mob" width="1" style="display:block;" class="wrapto100pc" alt="1996"> </a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="top" class="mobheightclear">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:20px 20px 0px 20px;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" style="padding:0px 0px 10px 0px; font-family:Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#004236;" class="textcenter">
We launch our Against Animal Testing campaign.
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 20px 10px 20px;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</th>
<th bgcolor="#f8f3e8" class="colsplit" style="width:213px;vertical-align: top;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 0px 0px 0px;">
<a href=""><img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1998" width="213" height="auto" style="display:block;height:auto;" class="nomob" alt="1998"></a>
<div style="width:0; overflow:hidden; float:left; display:none; max-height:0px; mso-hide:all;" class="show">
<a href=""> <img src="https://i1.adis.ws/i/thebodyshop/UK_trigger_WelcomeCJ_Day0_GroupADiscount_story_1998mob" width="1" style="display:block;" class="wrapto100pc" alt="1998"> </a>
</div>
</td>
</tr>
<tr>
<td align="center" valign="top" class="mobheightclear">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:20px 20px 0px 20px;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" style="padding:0px 0px 10px 0px; font-family:Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#004236;" class="textcenter">
We celebrate 50 years of human rights with Amnesty International.
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="left" valign="top" style="padding:0px 20px 10px 20px;">
<table width="100%" style="min-width:100%;" border="0" cellspacing="0" cellpadding="0">
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</th>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td style="font-size:0px" class="nomob"> </td>
</tr>
</tbody>
</table>
</div>
<!--[if mso]></td></tr></table><![endif]-->
答案 0 :(得分:1)
您不能更改第一个块(红色块)的高度,因为它是表格行中的单元格。您可能必须使用<div>
元素来控制高度因子。
有关更多详细信息,请参阅此帖子Change Height of a <td> without affecting the whole row height
此外,如果您最关心的是第一块图像下方的空白,则可以1)在下方添加一些内容,或者2)删除“ vertical-align:top;”。红色块的<th>
标签的inline-css属性,它将使图像在单元格的中心对齐。
希望这会有所帮助!