JSFiddle - React, Tailwind, and code Playground
HTML
<img class="header-img" src="http://lorempixel.com/400/200/" alt="Panoramic Fields" />
<div class="image-grad"></div>
CSS
.image-grad {
position: absolute;
z-index: 600;
transition: width 2s;
-webkit-transition: width 2s;
width: 100%;
min-height: 174px;
max-height: 608px;
/*background-image: url(images/header-img.png);
background-repeat: repeat-x;
background-position: bottom;*/
background-color:#000000;
top: 0;
left: 0;
}
.header-img {
position: relative;
z-index: 500;
width: 100%;
min-width: 1024px;
opacity: 0.0;
}
JavaScript
var imageGrad = $('.image-grad'),
image = $('.header-img');
function resizeDiv () {
imageGrad.height(image.height());
imageGrad.width(image.width());
}
resizeDiv();
$(window).resize(function() { resizeDiv(); });