2015-10-01 66 views
1

我想要做的是讓紅色箭頭與右側的文本對齊「在此問題中,您可以:」部分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;">&rsaquo;</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電子郵件,因此我需要儘可能使用樣式原語。

回答

2

http://jsfiddle.net/me42hfkw/1/

您可以降低p標籤的line height調整文本的位置。如果您使用的字體大小很大,則需要考慮很多空白區域。減小行高將消除該空白。

你提供的小提琴的區別在於它沒有p標籤,它在td裏面,在使用垂直對齊時「播放」會更好一點。

+0

'行高'的東西在瀏覽器中工作,但不是在我把HTML文件轉換成Outlook電子郵件後。 :( –

+0

刪除p標記並將樣式添加到父'td' –

+0

仍然無法在Outlook中工作如果我這樣做 –