CSS到内联样式转换器 [英] css to in-line styles converter
问题描述
我正在从Java应用程序发送电子邮件模板,但是由于我使用外部样式,这些电子邮件在gmail中的格式不正确,我知道外部样式无法在gmail中使用,但是我无法将模板更改为嵌入式样式,因为我需要申请动态使用单个html文件(模板)的不同样式,因此我使用外部样式,任何人都可以在Java中即时发送逻辑以将css转换为内联的逻辑,我在网络上找到了php和phython的解决方案,但我从未为java
找到
谢谢,
Sree
Hi,
I am sending email templates from my java application, but those emails are not well formatted in gmail as I am using external styles, i know that external styles wont work in gmail but I can not change my templates into inline styles because I need to apply the different styles for single html file(template) dynamically, so I am using external styles, can any one send the logic to convert css into inline on the fly in java, I found the solution for php and phython in the web but I never found for java
Thanks,
Sree
推荐答案
Sreeglp,
我建议您进行以下解决.
除了内联样式表,您还可以使用内部样式表.
Hi Sreeglp,
I will suggest following work around.
Instead of inline stylesheet, you can also use internal style sheet.
<style type="text/css">
...
</style>
<div>
... your template
</div>
因此,在这种情况下,请阅读CSS文件,并将字符串附加在HTML消息之前,以便它可以作为内部CSS使用.
问候,
Jitendra
So in this case, read the CSS file and append the string before your HTML message so that it should work as internal css.
Regards,
Jitendra
这篇关于CSS到内联样式转换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!