CKEditor 将 html 实体添加到内联 CSS 中。 CSS 还有效吗?

发布于 2024-08-27 12:34:25 字数 374 浏览 2 评论 0原文

我有这段代码:

<table style="background-image: url(path/to_image.png)"> 

当我将其加载到 CKEditor 中时,它会转换为:

<table style="background-image: url(&quot;path/to_image.png&quot;)">

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

伴梦长久 2024-09-03 12:34:25

它非常有效(实际上,这可能是唯一有效的方法!请记住这一点。),但我仍然会在主要电子邮件客户端中测试它以确保。众所周知,电子邮件中的 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.

醉殇 2024-09-03 12:34:25

是的,当然是这样。属性值不会仅仅因为包含 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).

韬韬不绝 2024-09-03 12:34:25

它是有效的,并且是 HTML 标准所要求的,但它不太可能在 Outlook Express 中工作。

It's valid, and required by the HTML standard, but it's unlikely to work in Outlook Express.

偏闹i 2024-09-03 12:34:25

无论如何,在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文