HTML email tips and tricks for Yahoo!

Email coding tips for Yahoo! Mail.

tip banner 2 uai

1. How to fix body attributes in Yahoo?

Yahoo removes the whole body tag, as well as all of its properties.

For example, this:

<body style=" background-color: #CEE2DF">.. 

Will get converted to this:

<body>
   <
div class="tripane content">
     <
div class="msg-body inner undoreset">
       <
div>... 

You can work around this by include styles in your embedded CSS. Your embedded body styles will be converted to inline and placed inside the div Yahoo builds around your email content.

For example, this:

<style>
   
body {background-color#CEE2DF}
</style>
<body>... 

Will get converted to this:

<body>
  <
div class="tripane content">
    <
div class="msg-body inner undoreset">
      <
div style=" background-color: #CEE2DF">... 

Note: Embedded CSS is not supported by Gmail. This client turns your body to a div as well, but it keeps its attributes as long as they're supported by a div. As a result, it's a good habit to keep your styles in both places.

2. How to fix margins around the body in Yahoo?

This question has a simple answer: no.

Many web-based email clients use embedded CSS, which may affect the appearance of your email. Yahoo wraps your HTML in a couple of divs. Consider the following scenario:

<body>
  
Content
</body

This will be transformed to:

<body>
<
div class="tripane content">
  <
div class="msg-body inner undoreset">
    <
div>
       
Content
    
</div>
  </
div>
<
div>
</
body

You can't change the styles for the divs it creates, but you can change the type selector classes within them.

Use embedded CSS to achieve this:

<style>
   
p {margin:0}
   h1 {font
-size:20px}
   
.mystyle div {margin:0}
   
.headers {font-size15px}
</style

Or, do everything inline:

<p style="margin:0"></p>
<
h1 style="font-size:20px"></h1>
<
div style="margin:0"></div>
<
span style="font-size:15px"></span

3. How to fix IE7 & 8 embedded styles for Yahoo?

Yahoo! Mail does not allow embedded styles in the head tags in Internet Explorer 7 and 8. Move your style block immediately before the closing body tag to see what happens.

For example, change this:

<html>
  <
head>
    <
style type="text/css">
      
p {margin-bottom1embackground:#096}
    
</style>
  </
head>
  <
body>
    <
p>This is the first paragraph</p>
    <
p>This is the second paragraph</p>
  </
body>
</
html

To this:

<html>
  <
head>
  </
head>
  <
body>
    <
p>This is the first paragraph</p>
    <
p>This is the second paragraph</p>
    <
style type="text/css">
      
p {margin-bottom1embackground:#096}
    
</style>
  </
body>
</
html

4. How to fix fonts in Yahoo?

Single quotes inside tags are converted to double quotes by Yahoo! Mail. It's possible that your inline font CSS declaration will not render properly if you use quotations.

For example:

<span style="font-family: 'Open Sans',sans-serif;color:#666666'>Test</span> 

Is converted to:

<span style="font-family: "Open Sans", sans-serif;color:#666666">Test</span

(The above example renders a serif font in all browsers as opposed to what was intended)

Note: Single quotes within your content are not affected.

5. How to fix the small space under all images in Yahoo?

The Yahoo! DOCTYPE is to blame for this empty space. Here are a couple workarounds (which also apply to Gmail and Outlook.com):

1) To the image element, apply the display:block style.

<img src="test.jpg" style="display:block"

2) In the image element, add align=absbottom.

<img src="test.jpg" align="absbottom"

3) To the picture element, add align=texttop.

<img src="test.jpg" align="texttop "

4) To the containing TD, add line-height:10px or lower.

<td style="line-height:10px"

5) To the containing TD, add font-size:6px or lower.

<td style="font-size:6px"

6. How to fix reformatted links in Yahoo? (Yahoo Shortcuts)

Yahoo Shortcuts are still alive and well! When you use popular link names like "Washer & Dryer," Yahoo! may place a span within your anchor with the class "yshortcuts." Here's an easy fix for you.

In your embedded CSS, include the following:

<style type="text/css">

  span.yshortcutsa span {color:#000}
  
span.yshortcuts:hover
  
span.yshortcuts:active,
  
span.yshortcuts:focus {text-decoration:nonecolor:#000; background-color:none; border:none} 

</style

This is just an example; you'll need to change the styling to suit your needs.

7. How to fix repetitive content in Yahoo?

If you send an email with a simple street address, especially one that includes a city and state, Yahoo may duplicate parts of your text at the bottom.

This is caused by pesky remnants of the Yahoo! Shortcuts plugin.

If this happens to you, the simplest solution is to trick Yahoo into believing your city and state are just another string of text.To do this, you can add an HTML entity like “­­” in your address that Yahoo does not recognize it:

­Austin­&#173;­TX ­78713-7458<br />
Phone512­-­&#173;555­-1212<br /> 

To avoid Gmail difficulties, we used the same special character in the phone number as in the previous case.

8. How to fix email overlapping in right column in Yahoo?

You may occasionally encounter an email that appears to be dangling off the right side of the frame when viewing broad emails. We purposely adjust the client's styles in our web client previews (Yahoo! Mail, Outlook.com, AOL Mail, Gmail, and others) so that your complete email is shown, even if it is wider than the viewing pane. We do this because we can't possibly account for all of the different email widths that may be sent through our system. No, it's not exactly how it'll appear in the live client, but it gives you a good idea of how much of the email will require horizontal scrolling. In a browser window of that size, the part of your email that overlaps the right column would ordinarily be hidden.

9. How to fix paragraphs space in Yahoo?

By default, Yahoo doesn't offer paragraphs any padding. If you want space after each paragraph, you'll need to use an inline or embedded style.

Inline example:

<p style="padding-bottom:1em;"

Embedded example

p {padding-bottom:1em;

10. Does Yahoo support media queries?

It certainly does! Yahoo! now fully supports media queries, thanks to a change implemented in 2015. To "fool" Yahoo! mail, attribute selectors are no longer required.

11. How to fix left aligned element to center in Yahoo?

In most browsers, align=”center” is ignored by Yahoo! Mail. Instead, we propose that you use:

style="margin:0 auto;" 

This should be placed inside a width=”100% ” wrapper on a table (or div).