I am trying to create HTML email template which will be send using PHP,
I have created template like 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} is {action}
</div>
</div>
</div>
</body>
When email sent, unfortunately there are no CSS applied to div contents, but if i plut style tag in div and put all style properties in div, then it get it correct,
I could not able to find why class css is not applying to email when defined as class,
Any advice?
Thanks,
<div style="background-color:#333; ....." >source code goes here</div>headand simple class selectors, but it does not support child selectors (>) and there is no mention of "multiple" classes. But as suggested in that guide, and the other answers here, if you need wider support then unfortunately it's "back to basics" as far as CSS in email is concerned.