Solved

HTML / HTML5 / CSS / Non-Browser apps like Thunderbird.

Posted on 2014-02-12
3
606 Views
Last Modified: 2014-02-13
I have an app that send emails.  The body of the email can be defined as HTML.   I want to use the bgcolor attribute of <body> to set the background color of the email.  Simple enough.   http://www.w3schools.com/tags/att_body_bgcolor.asp

However, "The bgcolor attribute of <body> is deprecated in HTML 4.01."  and "The <body> bgcolor attribute is not supported in HTML5. Use CSS instead."

So, I'm using Thunderbird as my email client, which is not a browser of course.  If I use the bgcolor attribute, Thunderbird recognizes it and all is well.  

So, how do HTML / HTML5 / CSS and  non-browser apps like Thunderbird work together / or not work together?   If I use the bgcolor attribute to set the background color of the email, do I run the risk of it not working at some point in the future?  If yes, would that imply that Thunderbird no longer supported HTML 4, but instead switched to HTML5?

Thanks for any feedback.
0
Comment
Question by:HLRosenberger
3 Comments
 
LVL 8

Assisted Solution

by:Adrian Crabtree
Adrian Crabtree earned 250 total points
ID: 39854284
Hi HLRosenberger,

A great guide to creating HTML emails can be found here: http://www.campaignmonitor.com/guides/coding/guidelines/.

What you can do is you inline styles to create your backgrounds, colors, etc. Here's an example:

<body style="background: #333">

Open in new window


Note that creating an email for every email client will be tricky if not impossible, but the link I gave you should give you a good understanding on how to go about it the best way. More guides from Campaign Monitor can be found here: http://www.campaignmonitor.com/guides/
0
 
LVL 2

Accepted Solution

by:
DualCool earned 250 total points
ID: 39854300
use inline css
 more email clients will except the inline css rather the deprecated html bgcolor
<body style="background-color:#060;">
</body>

or you can use both
the email clients that don't support one or the other will error silently
<body bgcolor="#E6E6FA" style="background-color:#060;">
<body >
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 39857068
That's the ticket.  Inline CSS. Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now