'How to stretch data-src image to a div tag width and height?

I have a tag such below :

<div data-thumb="http://aeo-azsharghi.ir/images/photo_2017-07-26_08-35-
    11_th.jpg" style="background-size: cover;" data-src="http://aeo-
    azsharghi.ir/images/photo_2017-07-26_08-35-11.jpg" data-alignment="topCenter">
</div>

My need is fitting image as a background image to div.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source