Reputation: 92772
I have inherited an app where users can insert their own HTML responses. I can only set a global CSS file and a global JS file for this app. Recently, some of the users have awakened an ancient evil, known as the <marquee>
and <blink>
tags.
I can't strip the tags out on input or output, could I at least disarm them with a CSS rule?
blink {
text-decoration: none;
}
The above gets rid of the blinking effect, is there a similar way to disable the marquee effect with CSS?
If worst comes to worst, I could use marquee { display:none }
, but sometimes the users put useful information in that tag; I don't have enough leverage there to argue "if it's marquee, it's unimportant by definition" (which has been a good enough approximation elsewhere).
Or am I trying to solve a non-technical problem by technical means, and should I educate the (internal) users on the Evils That Shall Not Be Invoked?
As it turns out, there is no CSS-only, cross-browser solution; I'll have to go the harder, JS way - probably replace marquee with span.
Upvotes: 4
Views: 4464
Reputation: 36862
Does this work for you?
marquee { overflow:visible; -moz-binding:none; }
For more visit Disabling deprecated html using css.
Upvotes: 5
Reputation: 26312
There is no CSS only cross-browser solution for that. The relevant properties were first introduced in CSS3. Some user agents may have already implemented it. For instance, in Webkit you can use the -webkit-marquee*
properties. In Gecko, setting -moz-binding: none
works as well, though its original purpose is different.
Otherwise, hiding all marquee
s at all indicates users not to use that element since it's no longer working.
Anyway, you can replace all marquee
elements in the DOM to span
s with JavaScript.
Upvotes: 4