How Do I Make Flashing HTML Text?

Save

If using a Firefox or Opera browser, there's a certain HTML tag called "<blink>" that you can use to make text automatically flash when loaded. This feature was added by Netscape in 1994 with the release of its browser but hasn't been adapted by other browsers such as Internet Explorer or Google Chrome. If you still wish to apply the blinking text effect on your site, JavaScript can be added to make the effect appear on all other browsers.

Using the Blink Tag

  • Open a new file on an HTML editor or Notepad.

  • Type in the following code: <blink>Place blinking text here</blink>.

  • Save the document as an HTML file and open it on a Firefox or Opera browser. This works for Firefox and Opera only.

Using JavaScript

  • Open a new file in your HTML editor or Notepad.

  • Type in the following JavaScript code in the "<head>" section of your HTML code:

    <script type="text/javascript">

    function doBlink() {

    var blink = document.all.tags("BLINK")

    for (var i=0; i < blink.length; i++)

    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 

    }

    function startBlink() {

    if (document.all)

    setInterval("doBlink()",1000)

    }

    window.onload = startBlink;

    </script>

  • Add the following code to the "<body>" section of your HTML: <blink>Place blinking text here</blink>.

  • Save your HTML file.

  • Open the file in any browser to see the blinking effect.

Tips & Warnings

  • If you wish to make your site compliant to Web Accessibility, blinking text isn't recommended as it may pose issues for site visitors with visual impairments and photosensitive epilepsy.

References

  • Photo Credit Jupiterimages/Photos.com/Getty Images
Promoted By Zergnet

Comments

You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!