blinking text in html

How to Make Text Blink in HTML

Two Methods:

Blinking text was never part of HTML's standard functions, and there's no approach that works for every browser. The closest option that uses only HTML is the marquee tag, but even this does not work with Google Chrome. JavaScript is a more reliable method, and you can copy-paste the code directly into your HTML document.


Using the Marquee Tag

  1. Use this for personal projects only.The marquee tag is obsolete, and developers are strongly encouraged to avoid it. Different browsers will display it differently, and future updates could prevent the text from blinking at all.  instead if you are creating a professional web site.
    • Google Chrome does not support the "scrollamount" attribute, which this method relies on.In that browser, your text will scroll across the page instead of blinking.
  2. Insert the marquee tags around the blinking text.Open your HTML document in a simple text editor. Type <marquee> in front of the text you would like to blink. Type </marquee> after the text.
  3. Set the text width.Change the opening tag to <marqueewidth="300">. This will not change the size of your font. There are two reasons why you might need to change this to a different number:
    • If your text does not fit, it will scroll instead of blinking. Increase the width to prevent this.
    • In Chrome, the text will scroll across a distance determined by the width.
  4. Set the scrollamount to the same value as the width.Inside the same tag, writescrollamount="300"(or the same number as the width). By default, marquee text scrolls across the page. By setting the scroll amount to the same number as the width, the text will "scroll" into the same position it was already in. This causes a blink effect.
    • Your text should now look something like this:
      <marquee width="300" scrollamount="300">Blinking text here.</marquee>.
  5. Change the scroll delay.Open the HTML file in a web browser to see the effect. If the text is blinking too quickly or too slowly, change the speed with the attributescrolldelay="500". The default delay is set to 85.Use a higher number for a slower blink, or a lower number for a faster blink.
    • You should now have:
      <marquee width="300" scrollamount="300" scrolldelay="500">Blinking text here.</marquee>
  6. Limit the number of blinks (optional).Many web users find blinking text annoying. To stop the animation once you've grabbed the reader's attention, enterloop="7". Now the text will blink seven times, then disappear. (You can use any number instead of seven.)
    • The completed code:
      <marquee width="300" scrollamount="300" scrolldelay="500" loop="7">Blinking text here.</marquee>

Using JavaScript

  1. Insert a blink script into the head of your HTML document.In between the <head> and </head> tags of your HTML document, insert the following JavaScript code:
    • function blinktext() {
        var f = document.getElementById('announcement');
        setInterval(function() {
 = ( == 'hidden' ? '' : 'hidden');
        }, 1000);
  2. Insert the command to load your script.The code above defined a function and named it "blinktext." In order to use this function in your HTML, change the <body> tag to <body onload="blinktext();">.
  3. Define your blinking text as an announcement.This script only affects elements with the id "announcement." Place your blinking text inside any element and give it that id. For example, type <p id="announcement">Blinking text here.</p> or <div id="announcement">Blinking text here.</div>.
    • You can rename this anything you like. Just make sure to use the same word in the script and the element id.
  4. Adjust the script.The number "1000" in the script sets the delay between blinks. This is in microseconds, so a value of 1000 makes the text blink once per second.Change this to a lower number to speed up the blinking, or a higher number to slow it down.
    • The actual delay probably won't match this value perfectly. It tends to be slightly shorter, but can take longer if your browser is busy with other requests.

Community Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
  • You can adjust the appearance of marquee text with the style attribute. Try adding style="border:solid".
  • You can include a height attribute inside the marquee tag as well as width, but many browsers will ignore it.You may notice a difference if you have added a border to the marquee.
  • You can also use CSS Animations to make text blink. This is fairly complicated, and not recommended for CSS beginners.

Video: Blink animation on HTML elements

How to Make Text Blink in HTML
How to Make Text Blink in HTML images

2019 year
2019 year - How to Make Text Blink in HTML pictures

How to Make Text Blink in HTML advise
How to Make Text Blink in HTML forecasting photo

How to Make Text Blink in HTML pictures
How to Make Text Blink in HTML images

How to Make Text Blink in HTML How to Make Text Blink in HTML new foto
How to Make Text Blink in HTML new pics

picture How to Make Text Blink in HTML
photo How to Make Text Blink in HTML

Watch How to Make Text Blink in HTML video
Watch How to Make Text Blink in HTML video

Communication on this topic: How to Make Text Blink in HTML, how-to-make-text-blink-in-html/
Communication on this topic: How to Make Text Blink in HTML, how-to-make-text-blink-in-html/ , how-to-make-text-blink-in-html/

Related News

How to Lose Weight Without Going to the Gym
Emmys Dark Cacao Macaroons
Publix Glucose Raspberry
Is it safe to use expired protein powder
Philosophy Amazing Grace Eau De Toilette Ornament (Limited Edition)
Bewitching Party Favor Bags
How to Order a Dumpster
5 Ways to Cook Cod
How to Keep Your Sense of Humor While Traveling
The Surprising Reason Your Hair Doesnt Look as Good as It Could
How To Pamper Your Hair With A Hot Oil Massage To Prevent Hair Loss

Date: 11.12.2018, 12:12 / Views: 82575