如何在单元格中创建图像填充HTML电子邮件的整个高度?

时间:2021-01-20 20:29:40

I've got a problem with an HTML email in that if the content is is increased the images that make up the left and right hand side are too short so it leaves a gap. I don't want to just make the images longer as this could leave lot of whitespace depending on content. I had the idea of using the same image twice with one set to valign=top and the other set to valign=bottom. I soon discovered it just stacks them one above the other though. Is it possible to make them effectively slide over each other so that the appearance is that the image grows as the content increases?

我对HTML电子邮件有一个问题,即如果内容增加,那么构成左侧和右侧的图像太短,因此会留下间隙。我不想让图像更长,因为这可能会留下很多空白,具体取决于内容。我有想法使用相同的图像两次,一组设置为valign = top,另一组设置为valign = bottom。我很快发现它只是将它们叠加在一起。是否有可能使它们有效地相互滑动,以便外观随着内容的增加图像的增长?

The specific table cell code is as follows:

具体的表格单元格代码如下:

<td width=162 valign=top style='padding:0cm 0cm 0cm 0cm'>
<img src="email/images/left-bar.jpg" name="left bar top"
 width=102 border=0  id="leftbartop"
 valign=bottom style='padding:0cm 0cm 0cm 0cm'>
<img src="email/images/left-bar.jpg" name="left bar bottom"
width=102 border=0  id="leftbarbottom"></td>

I have done some searching using a well known search engine and have only come across css functions for achieving this. I'm trying to steer clear of css and background images as outlook seems to be rather stubborn when it comes to displaying things involving background images.

我使用一个众所周知的搜索引擎进行了一些搜索,并且只是遇到了用于实现此目的的css函数。我正试图避开css和背景图像,因为在显示涉及背景图像的事物时,外观似乎相当顽固。

1 个解决方案

#1


1  

You would have to use an image with a background image as css position or z-index are not well supported. Set a background image to the top of your cell. You would then use valign="bottom" in your table cell to align the standard image tag bottom image.

您必须使用带有背景图像的图像,因为css位置或z-index不受支持。将背景图像设置到单元格的顶部。然后,您将在表格单元格中使用valign =“bottom”来对齐标准图像标记底部图像。

See backgrounds.cm for backgrounds that work in Outlook.

有关在Outlook中工作的背景,请参阅backgrounds.cm。

#1


1  

You would have to use an image with a background image as css position or z-index are not well supported. Set a background image to the top of your cell. You would then use valign="bottom" in your table cell to align the standard image tag bottom image.

您必须使用带有背景图像的图像,因为css位置或z-index不受支持。将背景图像设置到单元格的顶部。然后,您将在表格单元格中使用valign =“bottom”来对齐标准图像标记底部图像。

See backgrounds.cm for backgrounds that work in Outlook.

有关在Outlook中工作的背景,请参阅backgrounds.cm。