-
Table-Based Layout
-
Set the width in each cell, not the table
- Use px
- Avoid %
-
Padding
- <table cellpadding="20px"></table>
- <td style="padding:20px;"
- Choose one method;
Don't combine or mix
- Err towards nesting tables
- Use a container table for body background colors
- Avoid whitespace between tags <td></td>
-
CSS and Font Formatting
- Always Inline CSS
-
Avoid CSS Shorthand; Declare each attribute
- p { font: bold 1em/1.2em georgia, times, serif; }
- p {
font-weight: bold;
font-size: 1em;
line-height: 1.2em;
font-family: georgia, times, serif;
}
-
Links
-
Specify Color & Wrap Link Text in <span></span>
- <a href="http://site.com/" style="color: #6666;">
<span style="color: #666666;">This is a Link</span>
</a>
- Font >= 13px
-
Images
- Avoid Spacer Images
- Include the Dimensions of the Image
- Avoid PNGs
- Provide fallback colors for background images
- Don't forget alt="alt-text"
-
Outlook.com Hack
- img {
display: block;
}
-
Don't use floats
- <img src="image.jpg" align="right">
-
Mobile
-
Keep Total Width < 600 pixels
- 480
- 360
- 320
- Typical viewport sizes
-
Be aware of Automatic Text Resizing
- Problem?
-webkit-text-resize-adjust: none;