Book
Submodule 15.1: Canvas HTML element
Submodule 15.1: Canvas HTML element
Completion requirements
View
- Text
- Drawing
- Image
The HTML of a Canvas
It's easy to make a canvas on a Web page:
<canvas id="canvas0"
width="600"
height="400">
</canvas>
If you don't include the width and height, the canvas width and height will be by default 300x150 (Width x Height).
In Canvas you can also add CSS:
<style>
canvas { border: 1px solid blue;}
</style>
The above CSS rules will create a canvas displayed as: