开发者

how to overwrite inline styles in print css?

开发者 https://www.devze.com 2023-03-03 17:38 出处:网络
i know, inline styles are \"evil\", but ther开发者_运维百科e are inserted in html with javascript (jQuery animation). so, is it possible?This:

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

精彩评论

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