开发者

how to overwrite inline styles in print css?

i know, inline styles are "evil", but ther开发者_运维百科e are inserted in html with javascript (jQuery animation). so, is it possible?


This:

  <div style="background: red;">
        The inline styles for this div should make it red.
    </div>

Can be overridden with:

div[style] {
   background: yellow !important;
}

You can add !important to any css property


Try putting !important between the value and the semi-colon in your print stylesheet:

body {
    background-color: #0f0 !important;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜