Alternative for <blink>

Html

Html Problem Overview


The <blink> tag was never an official standard, and is now completely abandoned by all browsers.

Is there a standards compliant way of making text blink?

Html Solutions


Solution 1 - Html

.blink_text
{
    animation:1s blinker linear infinite;
    -webkit-animation:1s blinker linear infinite;
    -moz-animation:1s blinker linear infinite;
    color: red;
}

@-moz-keyframes blinker
{  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@-webkit-keyframes blinker
{  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@keyframes blinker
{  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
 }

    <span class="blink_text">India's Largest portal</span>

Solution 2 - Html

No there is not. Wikipedia has a nice article about this and provides an alternative using JavaScript and CSS: http://en.wikipedia.org/wiki/Blink_element

Solution 3 - Html

No, there isn't in HTML. There is a good reason why the developers chose to go out of their way to remove support for an element whose implementation was otherwise untouched for upwards of a decade.

That said... you could emulate it using a CSS animation, but if I were you, I wouldn't risk CSS animations being axed due to being abused in this manner :)

Solution 4 - Html

Please try this one and I guarantee that it will work

  <script type="text/javascript">
  function blink() {
  var blinks = document.getElementsByTagName('blink');
  for (var i = blinks.length - 1; i >= 0; i--) {
  var s = blinks[i];
  s.style.visibility = (s.style.visibility === 'visible') ? 'hidden' : 'visible';
}
window.setTimeout(blink, 1000);
}
if (document.addEventListener) document.addEventListener("DOMContentLoaded", blink, false);
else if (window.addEventListener) window.addEventListener("load", blink, false);
else if (window.attachEvent) window.attachEvent("onload", blink);
else window.onload = blink;

Then put this below:

<blink><center> Your text here </blink></div>

Solution 5 - Html

The blink element is being abandoned by browsers: Firefox supported it up to version 22, and Opera up to version 12.

The HTML5 CR, which is the first draft specification that mentions blink, declares it as “obsolete” but describes (in the Rendering section) its “expected rendering” with the rule

blink { text-decoration: blink; }

and recommends that the element be replaced by the use of CSS. There are actually several alternative ways of emulating blink in CSS and JavaScript, but the rule mentioned is the most straightforward one: the value blink for text-decoration was defined specifically to provide a CSS counterpart to the blink element. However, support to it seems to be as limited as for the blink element.

If you really want to make content blink in a cross-browser way, you can use e.g. simple JavaScript code that changes content to invisible, back to visible etc. in a timed manner. For better results you could use CSS animations, with somewhat more limited browser support.

Solution 6 - Html

You could take advantage of JavaScript's setInterval function:

const spanEl = document.querySelector('#spanEl');
var interval = setInterval(function() {
  spanEl.style.visibility = spanEl.style.visibility === "hidden" ? 'visible' : 'hidden';
}, 250);

<span id="spanEl">This text will blink!</span>

Solution 7 - Html

Blinking text with HTML and CSS only

<span class="blinking">I am blinking!!!</span>

And Now CSS code

    .blinking{
        animation:blinkingText 0.8s infinite;
    }
    
    @keyframes blinkingText{
        0%{     color: #000;    }
        49%{    color: transparent; }
        50%{    color: transparent; }
        99%{    color:transparent;  }
        100%{   color: #000;    }
    }

Solution 8 - Html

The blick tag is deprecated, and the effect is kind of old :) Current browsers don't support it anymore. Anyway, if you need the blinking effect, you should use javascript or CSS solutions.

CSS Solution

blink {
    animation: blinker 0.6s linear infinite;
    color: #1c87c9;
}
@keyframes blinker {  
    50% { opacity: 0; }
}
.blink-one {
    animation: blinker-one 1s linear infinite;
}
@keyframes blinker-one {  
    0% { opacity: 0; }
}
.blink-two {
    animation: blinker-two 1.4s linear infinite;
}
@keyframes blinker-two {  
    100% { opacity: 0; }
}

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    <h3>
      <blink>Blinking text</blink>
    </h3>
    <span class="blink-one">CSS blinking effect for opacity starting with 0%</span>
    <p class="blink-two">CSS blinking effect for opacity starting with 100%</p>
  </body>
</html>

sourse: HTML blink Tag

Solution 9 - Html

If you're looking to re-enable the blink tag for your own browsing, you can install this simple Chrome extension I wrote: https://github.com/etlovett/Blink-Tag-Enabler-Chrome-Extension. It just hides and shows all <blink> tags on every page using setInterval.

Solution 10 - Html

HTML Code

<span class="blinking">Am I blinking?</span>

CSS code

.blinking{
    animation:blinkingText 1.2s infinite;
}
@keyframes blinkingText{
    0%{     color: #000;    }
    49%{    color: #000; }
    60%{    color: transparent; }
    99%{    color:transparent;  }
    100%{   color: #000;    }
}

<span class="blinking">Am I blinking?</span>

Ref:https://html-online.com/articles/blinking-text-css-animation/

Solution 11 - Html

A small javascript snippet to mimic the blink , no need of css even

<span id="lastDateBlinker">
    Last Date for Participation : 30th July 2014
</span>

<script type="text/javascript">
    function blinkLastDateSpan() {
        if ($("#lastDateBlinker").css("visibility").toUpperCase() == "HIDDEN") {
            $("#lastDateBlinker").css("visibility", "visible");
            setTimeout(blinkLastDateSpan, 200);
        } else {
            $("#lastDateBlinker").css("visibility", "hidden");
            setTimeout(blinkLastDateSpan, 200);
        }
    }
    blinkLastDateSpan();
</script>

Solution 12 - Html

The solution below is interesting because it can be applied across multiple elements concomitantly and does not trigger an error when the element no longer exists on the page. The secret is that it is called passing as a parameter a function in which you must return the elements you want to be affected by the blink. Then this function is called back with each blink. HTML file below:

<!doctype>
<html>
	<head>
		<style>
			.blink {color: red}
		</style>
	</head>
	<body>
		<h1>Blink test</h1>
		<p>
			Brazil elected President <span class="blink">Bolsonaro</span> because he 
			was the only candidate who did not promise <span class="blink">free things</span>
			to the population. Previous politicians created an image that would 
			bring many benefits, but in the end, the state has been getting more and 
			more <span class="blink">burdened</span>. Brazil voted for the 
			realistic idea that <span class="blink">there is no free lunch</span>.
		</p>
	</body>
	<script>
	var blink =
		{
			interval_in_miliseconds:
				400,
			on:
				true,
			function_wich_returns_the_elements: 
				[],
			activate:
				function(function_wich_returns_the_elements)
				{
					this.function_wich_returns_the_elements = function_wich_returns_the_elements;
					setInterval(blink.change, blink.interval_in_miliseconds);
				},
			change:
				function()
				{	
					blink.on = !blink.on;
					var i, elements = [];
					for (i in blink.function_wich_returns_the_elements)
					{
						elements = elements.concat(blink.function_wich_returns_the_elements[i]());
					}
					for (i in elements)
					{
						if (elements[i])
						{
							elements[i].style.opacity = blink.on ? 1 : .2;
						}
					}
				}
		};
	blink.activate
	(
		[
			function()
			{
				var 
					i,
					node_collection = document.getElementsByClassName('blink'),
					elements = [];
				for (i = 0; i < node_collection.length; i++)
				{
					elements.push(node_collection[i]);
				}
				return elements;
			}
		]
	);
	</script>
</html>

Solution 13 - Html

can use this

@keyframes blinkingText
{
	0%{     opacity: 1;    }
	40%{    opacity: 0; }
	60%{    opacity: 0; }
	100%{   opacity: 1;    }
}

.blinking
{
	animation:blinkingText 2s reverse infinite;
}

Solution 14 - Html

Here's some code that'll substitute for the blink tag

<p id="blink">This text will blink!</p>
<script>
var blacktime = 1000;
var whitetime = 1000;
//These can be as long as you desire in milliseconds
setTimeout(whiteFunc,blacktime);
function whiteFunc(){
	document.getElementById("blink").style.color = "white";
	setTimeout(blackFunc,whitetime);
}
function blackFunc(){
	document.getElementById("blink").style.color = "black";
	setTimeout(whiteFunc,blacktime);
}
</script>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionstommestackView Question on Stackoverflow
Solution 1 - HtmlElangovanView Answer on Stackoverflow
Solution 2 - HtmlChristophe HerremanView Answer on Stackoverflow
Solution 3 - HtmlBoltClockView Answer on Stackoverflow
Solution 4 - HtmlReu RooView Answer on Stackoverflow
Solution 5 - HtmlJukka K. KorpelaView Answer on Stackoverflow
Solution 6 - HtmlTom O.View Answer on Stackoverflow
Solution 7 - HtmlFaridul KhanView Answer on Stackoverflow
Solution 8 - HtmlVazgen ManukyanView Answer on Stackoverflow
Solution 9 - HtmletlovettView Answer on Stackoverflow
Solution 10 - HtmlKuhanView Answer on Stackoverflow
Solution 11 - HtmlRaaghuView Answer on Stackoverflow
Solution 12 - HtmlDanielView Answer on Stackoverflow
Solution 13 - HtmlAli BagheriView Answer on Stackoverflow
Solution 14 - Htmluser6636878View Answer on Stackoverflow