[英]Want text element to align at the top of cell
我想做的是使紅色箭頭與http://jsfiddle.net/me42hfkw/的“在本期中,您可以:”部分中的右側文本對齊。 換句話說,我想要›
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
來調整文本的位置。 字體大小與您所使用的一樣大,因此要考慮很多空白。 減小行高將消除該空白。
您提供的小提琴的區別在於,該小提琴沒有在td
內使用p
標簽,而使用垂直對齊時,它可以“播放”更好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.