开发者

Inserting images in table cell flush

开发者 https://www.devze.com 2023-04-12 03:09 出处:网络
everyone. The problem with arriving late to the web design party, is that I don\'t know how to use tables or cells. I am trying to insert an image into a cell that I know has 215x145px and my image ha

everyone. The problem with arriving late to the web design party, is that I don't know how to use tables or cells. I am trying to insert an image into a cell that I know has 215x145px and my image has the same dimensions, only to find extra space in it.

Actually, firebug shows quite different heights but I honestly don't know how to solve this. This is one of the most hated and frustrtating aspects of email campaigns, at least for me.

Any h开发者_开发技巧elp is MOST appreciated.

Here's the code:

<table align="center"  width="725" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#0E6FA5"><span style="text-align: center; text-decoration: none;">
</td>
<td valign="top" height="145" bgcolor="#FFFFFF" width="215"
rowspan="2"style="border:0; padding:0; margin:0;"><span style="background-color: #FFF;
margin: 0; padding: 0; height: 145px; text-align: left;"></td>
</tr>
<tr>
<td bgcolor="#0E6FA5">&nbsp;</td>
</tr>
</table>

Inserting images in table cell flush


Well, since I forgot to mention that this situation was FF-related only, I feel it's only fair to share the solution I found:

http://www.webmasterworld.com/firefox_browser/3274620.htm

When in standards-compliance mode (due to the doctype), images are inline elements, not >>block-level. You can usually fix the problem with the extra space (present to account for >>the descender of any accompanying text) by the following CSS:

img {display:block;}

Or by adding style="display:block;" to your img element.

0

精彩评论

暂无评论...
验证码 换一张
取 消