Juanolo
Juanolo

Reputation: 133

how to overwrite inline styles in print css?

i know, inline styles are "evil", but there are inserted in html with javascript (jQuery animation). so, is it possible?

Upvotes: 2

Views: 3886

Answers (2)

ZippyV
ZippyV

Reputation: 13028

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

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

Upvotes: 2

Blowsie
Blowsie

Reputation: 40535

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

Upvotes: 4

Related Questions