Is it possible to make a css declaration override a style set in the element's style property?
Is it possible to make a css declaration override a style set in the element's style property?
eg:
开发者_运维百科<div class="root"><p style="font-size:13px;">hello</p></div>
Is there someway I can override the font size with css?
I already tried .root p{font-size:16px !important;}
The reason I want to do this is that I am making a javascript rich text editor, and sometimes when someone pastes into the editor, it adds styles like that. But I don't want it to appear as smaller text.
The following code looks wrong , remove the class=root on closing div.
<div class="root"><p style="font-size:13px;">hello</p></div class="root">
with jquery you can do it as below
fontsize can be a variable which you set dynamically
('selector').css('font-size',fontsize);
精彩评论