for an HTML newsletter I have to use the deprecated align attribute to position images – this works fine on the email, but in IE, the align attribute has no effect, so is it possible to target any elements containing align, and convert it to float? The content is being created in a CMS – I’d prefer to avoid asking the user to add classes to images if it could be avoided. Thanks!
Share
Assuming that the HTML is destined for a web page and not an online email client; To target all images that have the align attribute and convert it to float, you’d need something like the following:
Add more conversions if needed, I only added
leftandrightas an example.The reasons for explicitly converting each possible value is because
middle,topandbottomaren’t valid values forfloat. You’ll probably have to modify the CSS propertyvertical-align, but don’t quote me on that one.