I am trying to put a form inside a mail from my website.
I just discovered that in Hotmail, float:left;
and float:right;
doesn’t seems to work, even in a HTML e-mail.
Is there any way to get around it?
I am trying to put a form inside a mail from my website.
I just discovered that in Hotmail, float:left;
and float:right;
doesn’t seems to work, even in a HTML e-mail.
Is there any way to get around it?
Is Hotmail blocking some CSS properties when send mail with PHP?
100% nothing to do with Hotmail specifically or PHP specifically, but the sad state of HTML e-mail design in general.
Hotmail & others will not use float
values in CSS. In fact HTML e-mail is—in general—archaic and will force you to engage in design techniques that go all the way back to nested <table>
layout practices of the 1990s. As explained on this page on “Email Design Guidelines” from Campaign Monitor; emphasis mine:
Before getting into the details, there are some uncomfortable facts that those new to HTML email should be aware of. Building an email is not like building for the web. While web browsers continue their onward march towards standards, many email clients have stubbornly stayed put. Some have even gone backwards. In 2007, Microsoft switched the Outlook rendering engine from Internet Explorer to Word. Yes, as in the word processor. Add to this the quirks of the major web-based email clients like Gmail and Outlook.com, sprinkle in a little Lotus Notes and you’ll soon realize how different the email game is.
Which is all to say if you think you can simply take HTML & CSS code from your main website to repurpose as a pure HTML e-mail you are in for a very rude awakening. The world of HTML e-mail design is a whole world of design headaches unto itself.
Another good resource on the topic can be found in “The Foundations of Coding HTML Email” from Litmus; again the emphasis is mine:
Simply put, many HTML and CSS properties used in modern web design are not supported in email. Email programs like Outlook 2007 and 2010 actually use Microsoft Word (yes, a word processor) to render HTML. In other words, building an email is not like building a website, unless you’re still building websites like we did back in 1999.
They even include this great—and head noddingly well structured—“Email Coding 101” graphic explaining what you need to know when designing HTML e-mails. Yes, it’s not pleasant but this is the sad reality of HTML e-mails in 2014.