Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override element.style using CSS

Tags:

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?

like image 260
D-W Avatar asked Feb 16 '13 13:02

D-W


People also ask

How do you overwrite CSS in HTML?

... or add a <style> element in the <head> of your HTML with the CSS you need, this will take precedence over an external style sheet. You can also add !

How do I override SCSS style?

Overriding the Base Styles scss . In order to override a base style file, you need to copy over the chain of files that is used to import it.


1 Answers

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.

like image 148
DiscoInfiltrator Avatar answered Sep 21 '22 08:09

DiscoInfiltrator