JSFiddle - React, Tailwind, and code Playground
HTML
<div id="tekst1">Hallo Wereld.</div>
CSS
html, body, div, iframe,
img, canvas, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
body{
line-height: 1;
font-family: sans-serif;
}
/***********EINDE RESET******************/
#tekst1{
background-color: rgb(255,0,0);
}
JavaScript
var block=document.getElementById("tekst1");
block.innerHTML = "test";
var w=200;
move();
function move()
{
w=w-1;
block.style.width=w+'px';
if(w>30)
setTimeout(move,40);
}