首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在iphone应用程序的html中设置字体

如何在iphone应用程序的html中设置字体
EN

Stack Overflow用户
提问于 2013-06-04 12:30:54
回答 2查看 128关注 0票数 0

我正在html中设置字体,但它不起作用。这是我的代码。

代码语言:javascript
复制
    NSString * emailBody =@"<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:PEISupportServices@zoetis.com
    <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>";
EN

回答 2

Stack Overflow用户

发布于 2013-06-04 12:38:31

因为您的HTML无效。特别针对您需要的字体

代码语言:javascript
复制
<font color="#888888">

您正在将CSS语法与HTML语法混合在一起。您在任何地方也没有结束</font>标记。

此外,您的body标签在末尾也会打开。您需要</body>

票数 0
EN

Stack Overflow用户

发布于 2013-06-04 12:43:35

我以以下方式使用,字体名称和颜色

代码语言:javascript
复制
     - (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;

         }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16909851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档