Prevent hyphenation of words in html-letter in Outlook 2007 and Outlook 2010

This is my first post. So:

I am working on an HTML email newsletter using the same template that I have been using for some time. The template worked well until recently (a bit of code that I used below). Suddenly, Outlook 07/10 does not behave the way I realized that they behaved in the past. It seems that they do not respect the attribute of "white space" when it comes to hyphens. All other email clients behave as I expect (they respect the white space attribute).

One element in the newsletter is ISBN, which is a set of numbers separated by hyphens like "978-1-555-97610-1." ISBN is located in the span tag, which is part of the line of text inside the p tag, which, together with many other p-elements, and possibly img, is inside the table. I need ISBNs not to be hyphenated or wrapped in new lines.

I cannot use inextricable hyphens, and I studied this problem a lot in the past (I have a lot of ISBNs in my work), so I hope that I will not send something that has already been answered a billion times.

Any help is greatly appreciated!

Thanks Andrew.

CODE:

<p style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #000000; margin-bottom: 0px; text-align: right;"> Metropolitan Books &middot; 384 pages &middot; $18.00 &middot; paperback &middot; <span style="white-space: nowrap;">978-0-8050-9466-4</span> </p> 
+6
source share
4 answers

Use the <nobr> .

eg. <nobr>978-0-8050-9466-4</nobr>

+4
source

How about an inextricable hyphen &#8209;

+4
source

I needed to prevent the item from breaking into email viewed in Outlook 2013, but not breaking into spaces. As much as I hate hacking, the way I dealt with this problem was to use inextricable hyphens, but set their color to the background color of their parents:

 <div style="background-color: #fff; color: #000;"> New<span style="color: #fff;">&#8209;</span>Listing </div> 
+2
source

You might want to try adding width to this, if possible. Then it does not break.

-1
source

Source: https://habr.com/ru/post/913645/


All Articles