How to display a thumbnail through the background?

Standard Wordpress displays the thumbnail in the img, how to alter the background ?
You should get something like this...
dcd5e45903204a328fff16a95ddaa3ba.png
July 9th 19 at 12:56
1 answer
July 9th 19 at 12:58
Solution
Found the answer

<?php global $post; ?>
<?php
$src = wp_get_attachment_image_src( get_post_thumbnail_id($post--->id), array( 5600,1000 ), false, " );
?>

<div style="background: url(<?php echo $src[0]; ?> ) !important;">a text </div>

Find more questions by tags WordPress