1

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.

1 Answer 1

0

You have a mistake in your code, background image should have "",

check this example

background-image: url("paper.gif");

W3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.