簡體   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