Forum Moderators: not2easy
<head>
<link rel="stylesheet" type="text/css" media="screen,projection" href="./css/style_screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="./css/style_print.css" />
<style type="text/css">
<!--
.style12 {font-size: 12px}
.style13 {font-weight: bold}
.style14 {font-weight: bold}
-->
</style>
</head>
<body>
<div class="content1-container" align="left">
<!-- WORDPRESS BEGIN -->
<h1>test html test</h1>
<style type="text/css">
body { font-family: Verdana, Arial, Helvetica, sans-serif; cursor: auto; color: #000000; padding: 0px 0px 0px 0px; }
a { text-decoration: underline; color: #006666; }
a:active {color: #06ab22; }
a:hover {color: #06ab22; }
td { font-family: Arial, Helvetica, sans-serif; font-style: normal; font-size: 10pt; }
img {border: 0px;}
</style>
<p><html><body class="text"><br />
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<p>
Notification from: <b>blah blah</b></p>
<p><P>test class</P><br />
<hr /><span style="font-weight: bold">Attachments available for 30 days until Monday, March 28, 2011:</span><br /><a target="_blank" href="https://example.com/">test.pdf</a><br />
<hr />
<p></font></div>
<p></body></html></p>
<br />
<br />
<p><a href="http://www.example.com/wordpress/wp-login.php">Log in</a></p>
<!-- WORDPRESS END -->
</body>
</html>
[edited by: alt131 at 7:12 pm (utc) on Jul 9, 2011]
[edit reason] Examplifying href [/edit]
<style type="text/css">
body { font-family: Verdana, Arial, Helvetica, sans-serif; cursor: auto; color: #000000; padding: 0px 0px 0px 0px; }
a { text-decoration: underline; color: #006666; }
a:active {color: #06ab22; }
a:hover {color: #06ab22; }
td { font-family: Arial, Helvetica, sans-serif; font-style: normal; font-size: 10pt; }
img {border: 0px;}
</style> !important as well as that's the only way to overrule an inline style.. not lightly recommended really, mostly !important should be reserved for user styles.. but for this use case and the fact it's likely only temporary until you can find away to strip out embedded styles and inline styles before they reach your page (I would have thought there would be something you can put in the WP Loop to sanitise code?) - I don't see a problem using !important anyway.. html body {
font-family: georgia, arial, sans-serif;
color: #00f;
padding: 15px;
}
html body a {color: #f00;}
html body a:hover,
html body a:active {color: #dad;}
html body img {border: 5px solid #000;}
/* more specific using importantto reach those inline styles */
*[align=left] {text-align: right;}
font {
font-family: georgia, arial, sans-serif !important;
font-size: 12px !important;
}
span[style]{ /* doesn't work in IE7 */
font-weight: normal !important;
color: #f00 !important;
}
<font> element is actually very easily overruled as per your example, but I'd still use !important with it in case some emails actually have <font style=""> code blocks ;)