繁体   English   中英

如何覆盖打印CSS中的内联样式?

[英]how to overwrite inline styles in print css?

我知道,内联样式是“邪恶的”,但是在html中插入了javascript(jQuery动画)。 那么,有可能吗?

这个:

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

可以用:

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

您可以在任何CSS属性中添加!important

尝试在打印样式表的值和分号之间添加!important:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM