JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<div id="container">
    <input type="text" id="classic" />
    <input type="text" id="mimic-div" />
    <div id="div-prop"></div>
</div>

CSS

body
{
    margin: 10px;
}

div#container
{
    position: relative;
    width: 75%;
    height: 110px;
    background-color: cornflowerblue;
    -webkit-transition: all 1s ease-out;
    -moz-transition: all 1s ease-out;
    -o-transition: all 1s ease-out; 
    transition: all 1s ease-out;
}

input#classic
{
    width: 100%;
    padding: 5px;
    margin: 0;
    -webkit-box-sizing: border-box;
    
}

input#mimic-div
{
    position: absolute;
    bottom: 35px;
    left: 0px;
    right: 0px;
    height: 20px;
    background-color: lime;
    border: 0px;
    padding: 5px;
    margin: 5px;
}

div#div-prop
{
    display: block;
    position: absolute;
    bottom: 0px;
    left: 0px;
    right: 0px;
    height: 20px;
    background-color: crimson;
    border: 0px;
    padding: 5px;
    margin: 5px;
}

JavaScript

var tick = true;
setInterval(function() {
    if(tick) {
        $('#container').css('width', '25%');
        tick = false;
    }
    else {
        $('#container').css('width', '75%');
        tick = true;
    }
}, 1000);