【问题标题】:Can you stop hyphens in Outlook emails?你可以在 Outlook 电子邮件中停止连字符吗?
【发布时间】:2021-04-06 19:20:54
【问题描述】:

我正在开发一个电子邮件模板。在 Outlook 电子邮件中查看时,单词会分成两行并带有连字符。我在“td”标签上尝试了很多不同的 css 属性,但它什么也没做。

这根本无法控制吗?

  <tr>
     <td align="center" 
         style="text-transform: initial;
         letter-spacing: 0;
         font-size:40px;
         line-height: 48px;
         font-weight: 700;
         -webkit-text-size-adjust: 100%;
         -ms-text-size-adjust: 100%;
         mso-table-lspace: 0pt;
         mso-table-rspace: 0pt;
         word-break: break-word;
         -webkit-hyphens: none;
         -moz-hyphens: none;
         hyphens: none;
         border-collapse: collapse;">
        <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
        </div>
     </td>
  </tr>
  
  <!--This is just a spacer-->
  <tr>
     <td style="-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; mso-table-lspace: 0pt; mso-table-rspace: 0pt; word-break: break-word; -webkit-hyphens: none; -moz-hyphens: none; hyphens: none; border-collapse: collapse; line-height:20px; font-size:20px" height="20px">&nbsp;
     </td>
  </tr>

  <tr>
     <td align="center" 
         style="-webkit-text-size-adjust: 100%;
         -ms-text-size-adjust: 100%;
         mso-table-lspace: 0pt;
         mso-table-rspace: 0pt;
         word-break: break-word;
         -webkit-hyphens: none;
         -moz-hyphens: none;
         hyphens: none;
         border-collapse: collapse;
         line-height: 30px; 
         letter-spacing:0.02em;
         font-size:17px;
         line-height:30px;">
        <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
     </td>
  </tr>

【问题讨论】:

    标签: html css outlook html-email hyphenation


    【解决方案1】:

    有一个修饰符是我从有这个片段的来源获得的: w:自动断字 我把它拿出来了。

    【讨论】:

    • 发现hyphen 的设置位置真是太棒了!:)
    【解决方案2】:

    As mdn says:关于连字符:

    单词不会在换行符处换行,即使在 单词建议换行点。行只会在空白处换行。

    所以你可以创建一个类no-hyphens 并使用它:

    .no-hyphens {
        hyphens: none;
    }
    

    【讨论】:

    • 谢谢,您的建议适用于整个段落,并保持在一行中。我需要修正中间打断的单词。
    • @pitzki 没有代码真的很难说。您能否发布应该达到什么结果的代码和图像?
    • @pitzki 想要的结果是什么?
    • 底部没有连字符的图片。
    • 我的内联代码有连字符:无,但没有什么区别。
    猜你喜欢
    • 2014-02-23
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2012-09-12
    • 2017-12-07
    相关资源
    最近更新 更多