2013-06-04 49 views
0

我在html中設置字體,但它不工作。這是我的代碼。如何在HTML中設置字體爲iphone應用程序

NSString * emailBody [email protected]"<html><body>Thank you for your participation in 
    Consulting<br>Practitioner and Client Program.</br> 
    <br>Attached is the copy of your signed contract for your records 
    <p>Please email or fax your completed W-9 form to 
    <br>our PEI Support Team 
    <br>Email:[email protected] 
    <br>Fax:800-741-1310 
    <p><b><u><font color:'#888888'>IMPORTANT: Please provide invoice for this 
    consultation to your Zoetis Representative to ensure payment. 
    Do NOT mail directly to Zoetis.</u></b> 
    <p>Billing Address:<br>Zoetis<br>100 Campus Drive<br>Florham Park, NJ 07932 
    <body></html>"; 

回答

0

因爲您的HTML無效。特別爲您的字體,您需要

<font color="#888888"> 

您正在混合CSS語法與HTML語法。您也無法在任何地方關閉</font>標籤。

此外,您的身體標記在最後打開。您需要</body>

+0

它是不是也用工作 –

0

我在以下幾個方面,字體名稱和顏色

 - (NSString *)messageBody 
    { 


      NSMutableString *emailBody = [NSMutableString stringWithFormat:@"<div> \n" 
            "<p style=\"font:17px Helvetica,Arial,sans-serif\">%@</p> \n" 
            "<h1 style=\"font:bold 16px Helvetica,Arial,sans-serif\"><a target=\"_blank\" href=\"%@\">%@</a></h1> \n" 
            "<br> \n" 
            "<table align=\"center\"> \n" 
            "<tbody> \n" 
            "<tr> \n" 
            "<td valign=\"top\" align=\"center\"> \n" 
            "<span style=\"font-family:Helvetica,Arial;font-size:11px;color:#696969;font-weight:bold\"> \n" 
            "</td> \n" 
            "</tr> \n" 
            "<tr> \n" 
            "<td align=\"left\"> \n" 
            "<span style=\"font-family:Helvetica,Arial;font-size:11px;color:#696969\"> \n" 
            "Please note that you have not been added to any email lists. \n" 
            "</span> \n" 
            "</td> \n" 
            "</tr> \n" 
            "</tbody> \n" 
            "</table> \n" 
            "</div>", 
            self.message, 
            [self.appStoreURL absoluteString], 
            self.applicationName 
            ]; 

      return emailBody; 

     } 
相關問題