D-W D-W - 6 months ago 13
CSS Question

Override element.style using CSS

I have an HTML page from page builder, and it injects

style
attribute directly to the element. I found it's considered as
element.style
.

I want to override it using CSS. I can match the element, but it doesn't override it.

screenshot

How can I override the style using CSS?

Answer

Although it's often frowned upon, you can technically use:

display: inline !important;

It generally isn't good practice but in some cases might be necessary. What you should do is edit your code so that you aren't applying a style to the <li> elements in the first place.