希望文本元素在单元格顶部对齐
Want text element to align at the top of cell
我要做的是使红色箭头与 http://jsfiddle.net/me42hfkw/ 的 "In this issue, you can:" 部分右侧的文本对齐。换句话说,我想要 ›
s 这样的行
<td valign="top" style="font-family:Helvetica,Arial;padding-right:10px;padding-bottom:20px;">
<p valign="top" style="color:#FF0000;font-size:36px;font-weight:bold;margin-top:0;">›</p>
</td>
<td valign="top" style="font-family:Helvetica,Arial;padding-bottom:20px;">
<p style="color:#666666;line-height:18px;margin-top:0;">Learn about the IT and business trends driving walk-up service centers.</p>
</td>
</tr>
在单元格顶部对齐。我不明白为什么它不起作用;因为我能够让它在 http://jsfiddle.net/qprc69z1/ 上运行。我错过了什么?
顺便说一下,这是一封 HTML 电子邮件,因此我需要使用尽可能原始的样式。
http://jsfiddle.net/me42hfkw/1/
您可以减少 p
标签的 line height
来调整文本的位置。使用与您使用的一样大的字体大小,需要考虑很多白色 space。降低行高将消除白色 space.
您提供的 fiddle 之间的区别在于,它没有 p
标签,它位于 td
内,而 "plays"使用垂直对齐时好一点。
我要做的是使红色箭头与 http://jsfiddle.net/me42hfkw/ 的 "In this issue, you can:" 部分右侧的文本对齐。换句话说,我想要 ›
s 这样的行
<td valign="top" style="font-family:Helvetica,Arial;padding-right:10px;padding-bottom:20px;">
<p valign="top" style="color:#FF0000;font-size:36px;font-weight:bold;margin-top:0;">›</p>
</td>
<td valign="top" style="font-family:Helvetica,Arial;padding-bottom:20px;">
<p style="color:#666666;line-height:18px;margin-top:0;">Learn about the IT and business trends driving walk-up service centers.</p>
</td>
</tr>
在单元格顶部对齐。我不明白为什么它不起作用;因为我能够让它在 http://jsfiddle.net/qprc69z1/ 上运行。我错过了什么?
顺便说一下,这是一封 HTML 电子邮件,因此我需要使用尽可能原始的样式。
http://jsfiddle.net/me42hfkw/1/
您可以减少 p
标签的 line height
来调整文本的位置。使用与您使用的一样大的字体大小,需要考虑很多白色 space。降低行高将消除白色 space.
您提供的 fiddle 之间的区别在于,它没有 p
标签,它位于 td
内,而 "plays"使用垂直对齐时好一点。