This is possible with js and css. Please check the code below.
<canvas id="myCanvas" width="200" height="100"></canvas> <div id="myTextArea"></div> <script> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.strokeStyle="red"; ctx.moveTo(0,100); ctx.lineTo(200,0); ctx.stroke(); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.stroke(); </script> <style> html, body { margin: 0; padding: 0; } #myCanvas { padding: 0; margin: 0; width: 200px; height: 100px; } #myTextArea { position: absolute; left: 0px; right: 0; height: 102px; width: 202px; background: rgba(255,255,255,0); padding: 0; margin: 0; } </style> `
source share