I'm injecting an element onto the body of my HTML from the script using document.body.insertAdjacentHTML
. Once I do it the element pops up but is at the very top of the page, the method only has 4 different positions to choose from so I want to know how to change the position of the element or at least how to used position: fixed
on it cause its not working right now.
document.body.insertAdjacentHTML('afterbegin', `<canvas id="canvas"
style=
"
border-radius:10px;
width:600px;
height:300px;
position:fixed;
top:100px;
text-align:center;
box-shadow: rgba(0, 0, 0, 0.2) 0px 18px 50px -10px;
">
</canvas>`);