Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable [marquee] tag with CSS? Is this possible?

Tags:

html

css

marquee

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.

like image 492
Piskvor left the building Avatar asked Jan 24 '23 13:01

Piskvor left the building


1 Answers

Does this work for you?

marquee { overflow:visible; -moz-binding:none; }

For more visit Disabling deprecated html using css.

like image 129
Esteban Küber Avatar answered Jan 31 '23 02:01

Esteban Küber