Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

html - Override property in "style=" attribute?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...