Yann Simon
Yann Simon

Reputation: 81

Why on iPad inline CSS rules override !important

Normally the !important declaration overrides normal declarations.

But on iPad I found that my CSS rule !important was overriden by inline CSS rules (added with javascript)

enter image description here

(I checked on Safari with Mac I don't have this problem, neither with an Android tablet )

Do someone know why ?

Edit: My problem is that I have a twitter widget on my page, with an iPad when I switch from portrait to landscape: the widget stay at the portrait size

enter image description here

Upvotes: 2

Views: 942

Answers (1)

Katy Coello Coraspe
Katy Coello Coraspe

Reputation: 46

When you use a CSS sheet, you put all the style information once, at first. If you add or modify an element using javascript or jquery, it will add the new rule, because it overwrites everything.

Upvotes: 1

Related Questions