Answer the question
In order to leave comments, you need to log in
What's wrong with canvas?
Here is the code and picture of the canvas sized 100x100 -
But with the size 200x200 -
Why is it somehow elongated, what does it have in all browsers?
Here is the clean code -
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Canvas</title>
<script type="text/javascript">
document.addEventListener( 'DOMContentLoaded', document_domContentLoadedHandler );
function document_domContentLoadedHandler( ){
var canvas = document.getElementById( 'canvas' );
var context = canvas.getContext( '2d' );
context.fillStyle = "green";
context.fillRect(10, 10, 100, 100);
}
</script>
</head>
<body>
<canvas id="canvas"></canvas>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question