CKEditor 将 html 实体添加到内联 CSS 中。 CSS 还有效吗?
我有这段代码:
<table style="background-image: url(path/to_image.png)">
当我将其加载到 CKEditor 中时,它会转换为:
<table style="background-image: url("path/to_image.png")">
Is this still valid CSS?实际上,我不太感兴趣它是否有效,但如果任何网络浏览器或电子邮件客户端(编辑器用于撰写 html 电子邮件)会出现任何问题。 Firefox 和 Thunderbird 似乎对此很满意。
I have this piece of code:
<table style="background-image: url(path/to_image.png)">
And when I load it in CKEditor it's transformed in:
<table style="background-image: url("path/to_image.png")">
Is this still still valid CSS? Actually I'm not so interested if it's valid but if there would be any problems with any web browser or email client ( the editor is used for composing a html email ). Firefox and Thunderbird seem to be fine with it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
它非常有效(实际上,这可能是唯一有效的方法!请记住这一点。),但我仍然会在主要电子邮件客户端中测试它以确保。众所周知,电子邮件中的 HTML 支持非常糟糕。
It's very valid (Actually, this is probably the only valid way to do it! Got to keep this in mind.), but I would still test it in major E-Mail clients just to make sure. As we all know, HTML support in E-Mails is abysmal.
是的,当然是这样。属性值不会仅仅因为包含 CSS 或 URL 而不再是属性值。实体仍然有效(如果角色具有特殊含义,则实体是必需的)。
Yes, of course it is. Attribute values don't stop being attribute values just because they contain CSS or a URL. Entities still work (and are required if the character would otherwise have special meaning).
它是有效的,并且是 HTML 标准所要求的,但它不太可能在 Outlook Express 中工作。
It's valid, and required by the HTML standard, but it's unlikely to work in Outlook Express.
无论如何,在 Thunderbird 的电子邮件中使用
background-image: url()
是行不通的。除非他们修复了这个问题,否则 Thunderbird 不会显示背景图像。在其余的邮件客户端中,用户将收到警告,因为邮件正在尝试加载外部文件。
Anyway, using
background-image: url()
won't work in an email with Thunderbird. Unless they have fixed it, Thunderbird didn't show background images.And in the rest of mail clients, the user will get a warning because the mail is trying to load external files.