admin管理员组文章数量:1130349
I am trying to style a particular section of a blog post using the WordPress editor in HTML mode.
<div style="background: red;">
Special section
</div>
The works fine. But when I add background-image property, the whole style attribute gets stripped off when viewed on the blog.
<div style="background:red; background-image:url(https://.....jpg);">
Special section
</div>
How can I define and load css style for a specific post without editing in functions.php or adding definitions in Customizer Additional CSS.
I am trying to style a particular section of a blog post using the WordPress editor in HTML mode.
<div style="background: red;">
Special section
</div>
The works fine. But when I add background-image property, the whole style attribute gets stripped off when viewed on the blog.
<div style="background:red; background-image:url(https://.....jpg);">
Special section
</div>
How can I define and load css style for a specific post without editing in functions.php or adding definitions in Customizer Additional CSS.
Share Improve this question asked Jul 30, 2018 at 13:03 NigelNigel 1611 gold badge1 silver badge5 bronze badges1 Answer
Reset to default 0You have a mistake in your code, background image should have "",
check this example
background-image: url("paper.gif");
W3
I am trying to style a particular section of a blog post using the WordPress editor in HTML mode.
<div style="background: red;">
Special section
</div>
The works fine. But when I add background-image property, the whole style attribute gets stripped off when viewed on the blog.
<div style="background:red; background-image:url(https://.....jpg);">
Special section
</div>
How can I define and load css style for a specific post without editing in functions.php or adding definitions in Customizer Additional CSS.
I am trying to style a particular section of a blog post using the WordPress editor in HTML mode.
<div style="background: red;">
Special section
</div>
The works fine. But when I add background-image property, the whole style attribute gets stripped off when viewed on the blog.
<div style="background:red; background-image:url(https://.....jpg);">
Special section
</div>
How can I define and load css style for a specific post without editing in functions.php or adding definitions in Customizer Additional CSS.
Share Improve this question asked Jul 30, 2018 at 13:03 NigelNigel 1611 gold badge1 silver badge5 bronze badges1 Answer
Reset to default 0You have a mistake in your code, background image should have "",
check this example
background-image: url("paper.gif");
W3
本文标签: cssInline Style attribute getting stripped off
版权声明:本文标题:css - Inline Style attribute getting stripped off 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749079507a2312828.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论