You can simply position elements using absolute from Javascript:
function absElement(type, x, y, w, h) { let d = document.createElement(type); d.style.position = "absolute"; d.style.left = x + "px"; d.style.top = y + "px"; d.style.width = w + "px"; d.style.height = h + "px"; document.body.appendChild(d); return d; }
Then you can use it as
absElement("img", 100, 200, 400, 200).src = "myimage.jpg";
source share