Earlier versions of HTML and Internet browsers supported the
CSS example
To create a CSS blink class, copy the below CSS code into the head of your web page.
- CSS example
- JavaScript example
Once the above CSS code is inserted, you can use the “blink” class on any element. Below is a paragraph tag using the blink class.
example of blinking text using CSS.
Following all of the above steps gives you blinking text as shown below.
Example of blinking text using CSS.
JavaScript example
To create a JavaScript blink function, copy the below JavaScript code into the head of your page.
Once the above JavaScript is inserted in your page, you can call the function by adding the “blinking” class to any element. Below is a paragraph tag using the blinking class.
This JavaScript does also require that jQuery be loaded.
Example of blinking text using JavaScript.
Following all of the above steps gives you blinking text as shown below. You can adjust the values in the JavaScript to change the appearance of the blinking text.
Example of blinking text using JavaScript.
Related information
- See our
- HTML and web design help and support.