23 February 2012
Home > forum > blinking text in ie
 

How to make text blink in Internet Explorer?

The tag blink works in most standard browsers but is of course again an exception in Internet Explorer. The css property text-decoration:blink; also only doesn't work in IE. Why is it so hard to agree on a simple way to make text blink in all browsers?

In the early days of browsing the blink tag was invented together with the marquee tag and it worked in almost all browsers. But soon, blinking text became the equivalent of spam and annoyed all who saw it, so browsers decided not to support the tag anymore. The tags have never been included by W3C, so nobody knows for how long they will be supported. The text-decoration:blink; property has been included but some browsers (IE) do not support it. So, your best and most stable solution is to use javascript.

There is some simple javascript code that works in all browsers and is fully W3C proof. In short it works as follows. You add your blinking text inside a span tag and add for example the class blink to it. Now, you use javascript to get all elements with class blink and use javascript again to set its visibility to hidden or visible. This way, you can even decide how fast you would like to blink your text. It is best to get all requested elements by class name as this allows multiple blink classes to appear on your website instead of one.


and the html looks like

This is your first blinking text and your second text that should blink.

This is your first blinking text and your second text that should blink. To see some of the former used tags. The blink tag doesn't work in IE as does the blink text-decoration variant. Visit this page with any other browser and you see that it does work.

Rate this item
 
 
 
 
 

Rated 4.5: based on 2 ratings

Would you like to comment?




Fields with * are obligatory.

Save