JSFiddle - React, Tailwind, and code Playground

by darcyclarke

HTML

<div>
    <span></span>
</div>

CSS

body, html {
 height: 100%;
 width: 100%;
 padding: 0;
 margin: 0;
}
div {
 background: blue;
 width: 80%;
 height: 80%;
 display: block;
}
div span {
 position: absolute;
 background: red;
 height: 250px;
 width: 250px; 
 display: block;
}

JavaScript

$(window).resize(function(){
  var el = $("div span"), temp = el.clone().insertBefore(el);
  $("div span").
  temp.remove(); 
});