HTML and CSS Reference
In-Depth Information
var context = canvas.getContext("2d");
context.strokeStyle = "orange";
context.strokeRect(10,10,150,50);
context.fillStyle = "rgba(218,0,0,0.4)";
context.fillRect(150,30,75,75);
}
</script>
</head>
<body>
<h1> Simple Canvas Examples </h1>
<canvas id="canvas" width="300" height="300">
<strong> Canvas Supporting Browser Required </strong>
</canvas>
</body>
</html>
O NLINE http://htmlref.com/ch2/canvas.html
In a supporting browser, the simple example draws some rectangles:
Unfortunately, Internet Explorer up to version 8 will not be able to render the example
without a compatibility library:
Search WWH ::




Custom Search