JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Indie+Flower&display=swap" rel="stylesheet">

<div id="habrblock" style='background: url("https://hsto.org/files/df0/491/ba4/df0491ba483b4446bc9261be83f69ebd.png") 50% 50% no-repeat; height: 300px; width: 300px; display:flex; justify-content: center; align-items: center; color: #fff; font-size: 16px; line-height:16px; font-family: "Indie Flower", cursive; border: 1px solid #ddd;'>Hello!</div>

<a id='get'>Get</button>

JavaScript

get.addEventListener('click', function() {
html2canvas(document.querySelector("#habrblock")).then(canvas => { document.body.appendChild(canvas)
});
}, false)