Alternative for <blink>

后端 未结 14 2228
广开言路
广开言路 2020-11-27 06:39

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

Is there a standards compliant way of making text blink?

14条回答
  •  轮回少年
    2020-11-27 07:09

    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);
    This text will blink!

提交回复
热议问题