applying CSS in HTML mail with PHP -
i trying create html email template send using php,
i have created template below,
<head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>notification email template</title> <style type="text/css"> .portlet.box.blue-hoki { border: 1px solid #869ab3; border-top: 0; } .portlet.box.blue-hoki > .portlet-title { background-color: #67809f; } .portlet.box.blue-hoki > .portlet-title > .caption { color: #ffffff; } </style> </head> <body> <div class="portlet box blue-hoki"> <div class="portlet-title"> <div class="caption" > report # {report_id} {action} </div> </div> </div> </body>
when email sent, unfortunately there no css applied div contents, if plut style tag in div , put style properties in div, correct,
i not able find why class css not applying email when defined class,
any advice?
thanks,
there thins can, , cannot within emails using html/css.
one being using
<head></head>
styles set. apple mail.app supports it, gmail , hotmail not, it's no-no. hotmail support style section in body gmail still doesn't.link external stylesheet. not many email clients support this, best forget it.
what going have put of stylings inline elements want. this:
<head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>notification email template</title> </head> <body> <div style="border: 1px solid #869ab3;border-top: 0;"> <div style="background-color: #67809f;"> <div style="color: #ffffff;"> report # {report_id} {action} </div> </div> </div> </body>
i recommend reading blog posted on css-tricks (using css in html emails) gives bigger overview of can , cannot , how best things.
Comments
Post a Comment