RoundOutTooSoon
RoundOutTooSoon

Reputation: 9891

IE version <= 8: IE ignores custom css

I have a placeholder in the style attribute in HTML tags like this: style="custom_style: cssreplace". The purpose of this is that I can replace them with real CSS when I run JS code.

This tactic works on IE9 and IE10 but not on IE8 and earlier since then it renders the page, it just removes the "strange" custom styles.

Do you know if there is any "settings" (Doctype, etc..) in IE8 and earlier so that it doesn't ignore these tags?

Thanks.

Upvotes: 0

Views: 59

Answers (1)

Barmar
Barmar

Reputation: 780724

Use an HTML5 data attribute data-style="customer_style: css_replace". Then have your Javascript look for this and fill in the style appropriately.

Upvotes: 1

Related Questions