JSFiddle - React, Tailwind, and code Playground

HTML

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://github.com/cowboy/jquery-resize/raw/v1.1/jquery.ba-resize.min.js"></script>
<div id='parent'>
<div id='child'></div>
</div>

CSS

#parent {
    width:200px;
    height:200px;
    border:1px solid black;
}

#child {
    width:180px;
    height:180px;    
    border:1px solid black;
}

JavaScript

$(document).ready(function() {
    $('#parent').bind("resize", resizeChild);
    setTimeout(resizeParent, 2000);
});

function resizeChild()
{
    $("#child").css('width', $('#parent').width() - 20);
    $("#child").css('height', $('#parent').height() - 20);
}

function resizeParent() 
{
    $("#parent").css('width', '100px')
    $("#parent").css('height', '100px')  
}