在Outlook 2010的HTML电子邮件中打破长长的单词 [英] Break long words in html email in outlook 2010

查看:103
本文介绍了在Outlook 2010的HTML电子邮件中打破长长的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将最终用户输入并将其插入到HTML电子邮件中。但是,如果最终用户输入了一个较长的URL或者很长的单词,它会在Outlook 2010中打破我的HTML布局,将列或div扩展到超出指定的宽度。

在Chrome ,Firefox,IE7 +和Safari,我可以使用style =table-layout:fixed来强制表格列达到一定的宽度。但Outlook 2010忽略了这一点,而长词将表格宽度推出超出固定宽度。



使用Div,在Chrome,Firefox,IE7 +和Safari中,我可以使用style =word-wrap:break-word; overflow:hidden; width:100px来修复div的宽度。但在Outlook 2010中,它将div推出超出固定宽度。



如何让outlook2010包装长字,并遵守固定宽度?



以下是我的示例HTML:

 <!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> 
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< / head>
< body>
< table width =400style =table-layout:fixedborder =1>
< tr>
< td width =100>
yo
< / td>
< td width =300>
不要动我
< / td>
< / tr>
< / table>
< table width =400style =table-layout:fixedborder =1>
< tr>
< td width =100style =word-wrap:break-word; overflow:hidden; width:100pxborder =1>
yoooooooooooooooooooooooooooooooooooooooooooooooooooooo
< / td>
< td width =300>
雅让我感动
< / td>
< / tr>
< / table>
< table width =400border =1>
< tr>
< td width =100>
< div style =word-wrap:break-word; overflow:hidden; width:100pxborder =1>
yoooooooooooooooooooooooooooooooooooooooooooooooooooooo
< / div>
< / td>
< td width =300>
雅让我感动
< / td>
< / tr>
< / table>
< / body>
< / html>


解决方案

使用Microsoft专有的 -break:break-all;

 < td style =word-break:break-所有;> 


I'm taking end user input and inserting it into an HTML email. But if the end user enters a long URL or really long word, it breaks my HTML layout in Outlook 2010 by extending the column or div beyond the width specified.

In Chrome, Firefox, IE7+, and Safari, I can use style="table-layout:fixed" in order to force the table columns to certain widths. But Outlook 2010 ignores this, and the long word pushes the table width out beyond the fixed width.

With Divs, In Chrome, Firefox, IE7+, and Safari, I can use style="word-wrap:break-word; overflow:hidden; width:100px", to fix the div width. But in Outlook 2010, it pushes the div out beyond the fixed width.

How can I get outlook2010 to wrap the long word, and honor the fixed width?

Here is my sample HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<table width="400" style="table-layout: fixed" border="1">
    <tr>
        <td width="100">
            yo
        </td>
        <td width="300">
            Don't move me
        </td>
    </tr>
</table>
<table width="400" style="table-layout: fixed" border="1">
    <tr>
        <td width="100" style="word-wrap: break-word; overflow: hidden; width: 100px" border="1">
            yoooooooooooooooooooooooooooooooooooooooooooooooooooooo
        </td>
        <td width="300">
            Ya moved me
        </td>
    </tr>
</table>
<table width="400" border="1">
    <tr>
        <td width="100">
            <div style="word-wrap: break-word; overflow: hidden; width: 100px" border="1">
                yoooooooooooooooooooooooooooooooooooooooooooooooooooooo
            </div>
        </td>
        <td width="300">
            Ya moved me
        </td>
    </tr>
</table>
</body>
</html>

解决方案

Use the Microsoft proprietary word-break:break-all;

  <td style="word-break:break-all;"> 

这篇关于在Outlook 2010的HTML电子邮件中打破长长的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆