I\'m currently sending html formatted emails from PHP\'s mail() function and checking them simply to make sure they are showing up as HTML (formatting aside, I\'m well aware tha
The above answers are pretty good, just wanted to add a few more points. All credits to this link:
Gmail only supports <style>
in the <head>
. Gmail does support embedded styles (<style>
). However, embedded styles are only supported in the head of your HTML document. The Gmail Android and iOS apps does not support <style>
at all when rendering emails retrieved through non-Google accounts (GANGA).
Gmail removes your entire <style>
block if it encounters an error.
Gmail does not allow negative CSS margin values.
Gmail does not support attribute selectors and most pseudo-classes. e.g. div[class="content"]{ color: red }
. Gmail also does not support pseudo-classes like :checked
and :active
.
I see you're using an ID named #footer. It seems that Google doesn't recognize that name when dealing with mails. Notice that in the font code seen from gmail, all your ID might appear with "exc" + idName, except #footer. Try to use a different name.
GMail doesn't support <style>
tags and neither does a number of clients. To make your life easier, you can use convert to convert your style tags to inline CSS: https://templates.mailchimp.com/resources/inline-css/
I am updating my answer since it has quite a few views, and new tools are available. I am leaving my original answer for posterity.
Edit * 9/19/19
You can find CSS property support by email client here: https://www.caniemail.com/
Original Answer:
Gmail does not support the <style>
tag. You need to use inline css for gmail to work correctly.
Here's a reference list. http://www.campaignmonitor.com/css/