JSFiddle - React, Tailwind, and code Playground

by web5me

HTML

<div class="link-thumb" id="id">
    <a href="#">
        <img class="thumb" id="id" src="http://placekitten.com/100/100" alt="foo" width="100" height="100" />
        Frosted Flower Choker Necklace 18"
    </a>
</div>

CSS

.link-thumb { float: left; border: 1px solid gold; }
.link-thumb img { display: block; }

JavaScript

$('.thumb').on('load', function() {
    var $this = $(this);
    $this.closest('.link-thumb').width( $this.width() );
})