5

I have two stylesheets: a media="print" one and a media="screen" one. I also have some jQuery code that runs on window resize, changing the margin-left of a div.

Currently, this div is way off to the right when the user prints. I want the margin-left to always be zero when the user prints.

How could I go about doing this? Thanks in advance!

2
  • 1
    make the print rule !important, maybe?
    – Marc B
    Apr 10, 2012 at 21:30
  • adding !important to your stylesheet will override an inline style. Apr 10, 2012 at 21:30

2 Answers 2

8

Give it an id and set it to #your-id { margin-left: whatever !important; }

2
1

Using !important in your CSS stylesheet is one option.

Another option might be removing the inline style attribute, and then adding your own using removeAttr('style').

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.