JSFiddle - React, Tailwind, and code Playground
HTML
<div class="text-center main" style='height: 100%; width: 100%;'>
<canvas id='globe' style="background-color: red" ></canvas>
</div>
CSS
html,body {
height: 100%;
}
body {
margin: 0;
}
JavaScript
function resized(){
var canvas = $('#globe');
canvas.width(canvas.parent().width() );
canvas.height(canvas.parent().height() );
}
resized();
$("body")[0].onresize = resized;