gpt4 book ai didi

css - 时事通讯 - 固定高度的预告片

转载 作者:行者123 更新时间:2023-11-28 12:49:45 24 4
gpt4 key购买 nike

我正在开发一个用于电子邮件的时事通讯模板,我想要一个不能高于特定值的表格行/div,以便在太长的情况下不显示文本。

到目前为止,我尝试了两种不同的方法:只有表格:

<table border="0" cellpadding="0" cellspacing="0" class="teaser" style="table-layout:fixed; overflow:hidden; white-space: nowrap;letter-spacing: -0.01em; border-collapse: collapse; font-family: arial; text-align: left; cursor: pointer; margin: 0px; padding: 0px; border: 0px;">
<tbody style="margin: 0px; padding: 0px; border: 0px;">
<tr>
<td class="w480 normal-text" height="64" width="92" border="1" valign="top" align="left" style="color: #6f6f6f; font-size: 12px; line-height: 15px; border: #6f6f6f;">
<a href="#" target="blank" style="border:0px;text-decoration:none;color: #6f6f6f;">
<img src='testImage.jpg' alt='' style='border:0px' />
</a>
</td>
<td width="298" height="64" valign="top" style="color: #6f6f6f; border: #6f6f6f;">
<h1 style="font-family: arial; font-size: 12px; font-weight: bold; line-height: 15px; vertical-align: top; text-transform: uppercase; margin: 0px; padding: 0px;">
<a href="#" target="blank">
<span style="color: #6f6f6f; line-height: inherit; text-decoration: none; position: relative; letter-spacing: 0.03em; top: -2px; margin: 0px; padding: 0px; border: 0px;">
Quias alitatem <br />qui cullat
</span>
</a>
</h1>
<a href="#" target="blank" style="border:0px;text-decoration:none;">
<p class="normal-text no-overflow" style="font-size: 12px; line-height: 15px; overflow: hidden; margin: 4px 0px 0px;color: #6f6f6f">
WelIpsamus pe invenda quiatur? Quias alitatem qui cullat lique num et molor sitempo rionse. WelIpsamus pe invenda quiatur? Quias alitatem qui cullat lique num et molor sitempo rionse.
</p>
</a>
</td>
</tr>
</tbody>
</table>

使用表格和 div:

<table border="0" cellpadding="0" cellspacing="0" class="teaser" style="table-layout:fixed; overflow:hidden; white-space: nowrap;letter-spacing: -0.01em; border-collapse: collapse; font-family: arial; text-align: left; cursor: pointer; margin: 0px; padding: 0px; border: 0px;">
<tbody style="margin: 0px; padding: 0px; border: 0px;">
<tr>
<td class="w480 normal-text" height="64" width="92" border="1" valign="top" align="left" style="color: #6f6f6f; font-size: 12px; line-height: 15px; border: #6f6f6f;">
<img src='testImage.jpg' alt='' />
</td>
<td width="298" height="64" valign="top" style="color: #6f6f6f; border: #6f6f6f;">
<div style='height:64px; overflow:hidden;'>
<h1 style="font-family: arial; font-size: 12px; font-weight: bold; line-height: 15px; vertical-align: top; text-transform: uppercase; margin: 0px; padding: 0px;">
<span style="color: #6f6f6f; line-height: inherit; text-decoration: none; position: relative; letter-spacing: 0.03em; top: -2px; margin: 0px; padding: 0px; border: 0px;">
Quias alitatem <br />qui cullat
</span>
</h1>
<p class="normal-text no-overflow" style="font-size: 12px; line-height: 15px; margin: 4px 0px 0px;">
WelIpsamus pe invenda quiatur? Quias alitatem qui cullat lique num et molor sitempo rionse. WelIpsamus pe invenda quiatur? Quias alitatem qui cullat lique num et molor sitempo rionse.
</p>
</div>
</td>
</tr>
</tbody>
</table>

它们在任何浏览器的预览中都运行良好。但是当收到电子邮件时,行/格的高度不受尊重。有什么方法可以达到预期的效果吗?

最佳答案

试试 table-layout:fixed;。它将强制表格优先于内容。

不确定它是否在电子邮件中 ​​100% 受支持,所以让我知道您如何测试它。

关于css - 时事通讯 - 固定高度的预告片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17090961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com