How to Make Text Blink in HTML

There are four ways to cause a Web page to display blinking text when the page is displayed in a Web browser. You can use the HTML <blink> tag to affect the display of any text on the Web page. You can add the declaration "text-decoration: blink" in the Web page's HTML file. You can add the declaration "text-decoration: blink" in the Cascading Style Sheet (CSS) file that governs the display of the Web page. Or you can add custom JavaScript code in the Web page's HTML file that causes the text to blink, that is, to appear and disappear repeatedly.

Step

Run the text editor, then open the file that contains the Web page's text. The file's name extension can be .htm, .html, .xhtml, .xhtm, or others.

...

Step

Enclose between the HTML tags <blink> and </blink> the text you want to appear blinking. You can use the <blink> tag with any text that is displayed on the Web page, such as in headings, in paragraphs, or in tables.

Step

Save the text file you just edited.

Step

Run the text editor, then open the file that contains the Web page's text. The file's name extension can be .htm, .html, .xhtm, .xhtml, or others.

...

Step

Check whether the HTML file includes a line that reads "<style type="text/css">". If not, after the line that reads "<head>" add the lines shown in this example.

...

Step

Between the line that reads "<style type="text/css">" and the line that reads "</style>", add the line of text shown in this example. As an example, this line causes all text on this Web page with the tag "<h1>" to appear blinking. Use this technique to affect any heading text (h1, h2, h3, ... h6), the entire body of the Web page (body), or text having a particular HTML tag.

Step

Save the text file you just edited.

Step

Start the text editor, then open the Cascading Style Sheet (CSS) file that controls the presentation of the Web page with text you want to appear blinking. The file's name extension can be .css or others. It might, or might not, be found in the same folder or directory as the HTML files whose display it governs.

...

Step

In the CSS file, look for either of the two lines shown in this example. In the example, the ellipses ("...") indicate that any text might be found in that part of the line in your CSS file.

...

Step

Add or edit the lines as shown in this example. For any HTML file that refers to this CSS file, the new line causes all text marked with the "<p>" tag to appear blinking when viewed in the Web browser.

...

Step

To cause only a piece of text tagged with a given ID to appear blinking, edit the CSS file and HTML file as shown in this example. In the HTML file, to declare this ID, you can edit the HTML tag in this way for any piece of text.

...

Step

Start the text editor. In a new text file, enter the lines shown in this example. Save the text into a file with name extension .htm.

Step

Open the new HTML file in your Web browser. Notice that the line "Your text" is blinking. This result should occur in almost any Web browser--including Microsoft Internet Explorer--in which JavaScript is enabled.

Step

To use the JavaScript program shown in the example, copy the lines of the program from the new HTML file and paste them into another HTML file after the line with the tag "<body>". In the other HTML file, ensure that the line with the tag "<body>" includes inside the brackets this text: onload="setInterval('blinkIt()',500)"

Step

Start your Web browser.

Step

Open the HTML file in the Web browser. There are three ways to do so:

Step

-Drag the file's icon into the browser's window. -Select the File > Open command and use the Open dialog to select the file to open. -Enter the file's name in the browser's Location (or URL) field.

...

Step

As shown in this example, if you logged on your computer as "JBrown" and the file My-File.html is found on your Desktop, then on a Windows PC enter file:///C:/Documents%20and%20Settings/JBrown/Desktop/My-File.html and press Enter, or on a Mac enter file:///Users/JBrown/Desktop/My-File.html and press Enter.