+ 1
How to write a HTML code to blinking words
5 Answers
+ 15
What are blinking words?
+ 9
<span class="blink">blink</span>
<style>
.blink {
-webkit-animation:blink 1s ease-in-out infinite;
animation:blink 1s ease-in-out infinite;
}
@-webkit-keyframes blink {
from { opacity:1; }
50% { opacity:0; }
to { opacity:1; }
}
@keyframes blink {
from { opacity:1; }
50% { opacity:0; }
to { opacity:1; }
}
</style>
0
Add this to the <head> section of your html:
<script>
function white() {
document.body.style.color = "white";
window.setTimeout(black, 500);
}
function black() {
document.body.style.color = "black";
window.setTimeout(white, 500);
}
<script>
//////////////////
Then for the <body> tag be sure to write <body onload="white()">
///////////////////////
This will cause all elements in the body that are not themselves their own containers to blink every 1/2 second but you can get it to blink at .001 seconds aka. one millisecond.