JSFiddle - React, Tailwind, and code Playground
by paislee
HTML
<div id="img-container">
<img class="center" src='http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif' />
</div>
<div id="two">
<img class="center" src='http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif' />
</div>
CSS
#img-container {
width: 500px;
height: 400px;
background: black;
}
#two {
width: 500px;
height: 400px;
background: blue;
}
JavaScript
$('img.center').parent().css('text-align','center');