JSFiddle - React, Tailwind, and code Playground
HTML
Centering example:
<div id="container">
<div id="content">
Line 1
</div>
</div>
CSS
body {
font: 36px Arial, sans-serif;
}
#container {
color: white;
background: #ffbd17;
width: 400px;
height: 260px;
display: flex;
justify-content: center;
align-items: center;
}
#content {
background: #06c;
}
JavaScript
(function() {
var toggle = true;
setInterval(function() {
if (toggle) {
$("#content").html("Line 1");
} else {
$("#content").html("<div>Line 1</div><div>Line 2 here here</div>");
}
toggle = !toggle;
}, 1300);
}());