Saturday, 21 November 2015

create a canvas in:HTML5

create a canvas in:HTML5
create a canvas in:HTML5
canvas on the "HTML5" is used to draw on a web page. the canvas, we can include 2D or 3D objects into a web page. In the "HTML 5" canvas can not work alone so it takes the name of Javascript to create objects in it either 3D or 2D.

<!DOCTYPE html>
<html>
<body>
<canvas id="canvas" width="200" height="100" style="border:1px solid #000000;">your browser not support html 5</canvas>
</body>
</html>
<html>



 <canvas id="canvas" width="200" height="100" style="border:1px solid #000000;"></canvas> 
program "canvas" allows you to create a place to draw something.

RESULT
create a canvas in:HTML5


If you want to add "background color", you just replace the code "# 000000" with other colors.like the example below.

<!DOCTYPE html>
<html>
<body>
<canvas id="canvas" width="200" height="100" style="background: azure;border:1px solid #000000;">your browser not support html 5</canvas>
</body>
</html>
<html>

RESULT
create a canvas in:HTML5


No comments:

Post a Comment