Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override property in "style=" attribute?

Tags:

html

css

I am trying to adjust the position of the background image of a button in CKEditor.

CKEditor hard-codes button images with background-position: 0px 0pt. I don't want to change this, as it seems to be in the editor's core.

I can, however, set a custom class for the button and style that in the style sheet. But because the background-position statement is made in the style attribute, I can't overwrite it from a class, not even using !important.

Is there any way to override a CSS property in the style= attribute in a CSS class?

I don't think there is. Anybody know any workarounds?

like image 743
Pekka Avatar asked Dec 19 '09 15:12

Pekka


People also ask

How do you override property in CSS?

To override the CSS properties of a class using another class, we can use the ! important directive. In CSS, ! important means “this is important”, and the property:value pair that has this directive is always applied even if the other element has higher specificity.

How do you override a style in HTML?

Override CSS style in HTML (All type CSS) To only way to override inline style is by using ! important keyword beside the CSS rule.

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

The only way to override the properties specified in a style attribute is to use !important.

like image 138
Gumbo Avatar answered Oct 03 '22 01:10

Gumbo