我正在编写一个电子邮件HTML模板,有些电子邮件客户端不支持< style>用于指定CSS。应用CSS的唯一替代方法是使用内联样式(样式属性)。是否有一个工具或库(Node.JS)用于将样式表应用于某些HTML并返回带有应用样式的HTML?
该工具不必支持许多选择器; id,类和元素名称选择器应该足以满足我的需要。
需要什么的例子:
// stylesheet.css a { color: red; } // email.html <p>This is a <a href="http://example.com/">test</a></p> // Expected result <p>This is a <a href="http://example.com/" style="color: red;">test</a></p>@H_403_8@