JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <div id="inner"></div>
    <div id="other"></div>
</div>

<p id="info"></p>

CSS

div {
    width: 150px;
    border: 1px solid black;
    display: -webkit-flex;
    display: flex;
}

#inner {
    width: 50px;
    height: 50px;
    margin: auto;
}

#other {
    width: 20px;
    height: 50px;
    margin-right: 10px;  
}

JavaScript

var innerStyle = window.getComputedStyle(document.getElementById('inner')),
    paragraph = document.getElementById('info');

paragraph.innerHTML = innerStyle.getPropertyValue('margin-top') + ' '
                        + innerStyle.getPropertyValue('margin-right') + ' '
                        + innerStyle.getPropertyValue('margin-bottom') + ' '
                        + innerStyle.getPropertyValue('margin-left');