Blink
Blogs Design & Development

How to use Blink tag in HTML

By

As you may all know, Blink is the term for turning on and off any light in a regular pattern or within a predetermined time interval. A non-standard HTML element called the HTML blink tag can be used to make a text or group of texts in a web browser flash or gradually blink. Text blinking is typically not utilized since it irritates users or viewers to constantly watch text flashing.

Although some browsers no longer support this functionality, the blink feature is still supported by this tag. For instance, Netscape version 5.0 supports the blink function. It is recommended against using the Blink Tag because there’s a potential your page could break if the browser does not support it. Alternatively, site developers can make texts twinkle by combining CSS and JavaScript.

This tag was typically used to give text on a webpage a fancy look. It was also utilized to draw the audience’s attention by displaying some exclusive deals, specific information, and instructions.

It is a container tag, much like other HTML tags, and every text typed within it will have the blink effect.

Syntax:

<blink> Here is your text that has to blink. </blink>

This is an example HTML script that demonstrates how Blink functions:

Example:

<!DOCTYPE>
<html>

    <head>
        <title> Here is an example of Blink Element of HTML </title>
        <style>
            blink {
                color: #2d38be;
                font-size: 15px;
                font-weight: bold;
            }
        </style>
    </head>

    <body>
        <h1> About HTML BLINK Tag</h1>
        <blink> Blink tags in HTML are no longer utilized and are not supported by the majority of browsers. With your current browser, it most likely won't work.</blink>
        <p> See the effect above </p>
    </body>

</html>

If the browser does not support the Blink element, you can also choose to implement the Blink feature. Use the animation: blink 2s ease infinite; CSS animation property. Now, you need to confirm that the style has been applied and is working for every text section you have used in the HTML, such as <P>, <SPAN>, <DIV>, and so on. These days, using the style and embedding the text-decoration with blink value is a typical practice. Since adding the SPAN tag to it doesn’t improve the text’s other structuring, it is seen as the best course of action.

For blinking, use JavaScript.

JavaScript has the potential to be a great substitute for the HTML blink element. This is an example of how to use it in some code.

Example:

<!DOCTYPE html>
<html>

    <head>
        <title> Blinking feature using JavaScript </title>
        <style>
            #blink {
                font-size: 20px;
                font-weight: bold;
                color: #2d38be;
                transition: 0.5s;
            }
        </style>
    </head>

    <body>
        <p id="blink"> This is an example of blinking text using JS. </p>
        <script type="text/javascript">
            var blink = document.getElementById('blink');
            setInterval(function() {
                blink.style.opacity = (blink.style.opacity == 0 ? 1 : 0);
            }, 1500);
        </script>
    </body>

</html>

For blinking, use CSS.

The simplest way to create blinking text is with CSS. It has the @keyframes rule, which repeats and modifies the current style every predetermined amount of time.

Example:

<!DOCTYPE html>
<html>

    <head>
        <title>Blinking feature using CSS</title>
        <style>
            .blink {
                animation: blinker 1.5s linear infinite;
                color: red;
                font-family: sans-serif;
            }
            @keyframes blinker {
                50% {
                    opacity: 0;
                }
            }
        </style>
    </head>

    <body>
        <p class="blink"> This is an example of blinking text using CSS. </p>
    </body>

</html>

You may also like