I am a CSS
fresher.
I was expecting a black square as a result of the following code but I only get a black rectangle.
Can anyone tell me where the problem is?
Here is my code:-
<!DOCTYPE html>
<html lang="en">
<head>
<style>
canvas {
width: 800px;
height: 800px;
border: 3px solid black;
}
</style>
</head>
<body>
<canvas id="cv" class="cav"></canvas>
<script>
var canvas = document.getElementById('cv')
var context = canvas.getContext('2d')
context.fillRect(30, 30, 150, 150)
</script>
</body>
</html>