You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

iPhone端字体显示异常,桌面端正常的问题求助

问题分析与解决方案

核心问题

你的页面在移动端显示异常,主要有两个原因:

  1. 行内样式优先级冲突:table和td标签的行内样式里硬编码了font-family:'Open Sans',sans-serif,其优先级高于全局CSS的*选择器,移动端系统预装了Open Sans字体,因此会优先显示它;而桌面端可能没有预装Open Sans,所以自动 fallback 到Comic Sans。
  2. 跨系统字体名称差异:Comic Sans在不同系统的官方名称不一致,Windows用"Comic Sans MS",iOS用"Comic Sans",单一名称无法覆盖所有设备。

具体修复步骤

1. 移除冲突的行内样式

删除table和td标签中style属性里的font-family:'Open Sans',sans-serif,避免强制指定字体覆盖全局设置:

<table id="u_content_text_3" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
  <tbody>
    <tr>
      <td class="v-container-padding-padding" style="overflow-wrap:break-word;word-break:break-word;padding:0px 10px 10px 20px;" align="left">
        <div class="v-color v-text-align" style="color: #000000; line-height: 170%; text-align: left; word-wrap: break-word;">
          <p style="font-size: 14px; line-height: 170%; text-align: center;">
            <span style="font-size: 20px; line-height: 34px; font-family:'Comic Sans MS','Comic Sans',cursive;">
              Demonstrate your affection to the special person in your life express your love, whether it be on a special occasion or just make the effort to show that you care.<br />Let your actions speak louder than words and show how much you truly love them.
            </span>
          </p>
        </div>
      </td>
    </tr>
  </tbody>
</table>

2. 统一跨系统字体声明

修改CSS中的字体设置,兼容不同系统的Comic Sans名称,并添加通用手写字体作为 fallback:

/* 若不需要自定义myFont,可直接删除该@font-face规则 */
/* @font-face {
  font-family: "myFont";
  src: url("myFont.woff2") format("woff2"),
       url("myFont.woff") format("woff"),
       url("myFont.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
} */

html {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  /* 若保留myFont,调整为:font-family: "myFont", "Comic Sans MS", "Comic Sans", cursive; */
}

code {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

table,
tr,
td {
  vertical-align: top;
  border-collapse: collapse;
  background-color: #f7f2db;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

p {
  margin: 0;
}

* {
  line-height: inherit;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

3. 自定义字体兼容(可选)

如果你的myFont是自定义的Comic Sans字体包,需补充多格式字体文件以兼容移动端,并确保文件路径正确、无跨域问题:

@font-face {
  font-family: "myFont";
  src: url("myFont.woff2") format("woff2"),
       url("myFont.woff") format("woff"),
       url("myFont.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

内容的提问来源于stack exchange,提问作者bob21

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 20:35:04