1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| <!DOCTYPE html>
<html>
<head>
<title>Les canvas</title>
<meta charset="utf-8">
<style>
body{
margin: 0px;
padding: 0px;
}
#canvas1{
background-color: orange;
}
</style>
</head>
<body>
<canvas id="canvas1" width="250" height="100"></canvas>
<script>
var canvas= document.getElementById("canvas1");
var contexte= canvas.getContext("2d");
contexte.lineWidth= "5";
contexte.strokeStyle= "black";
contexte.stokeRect(50,10,150,80);
</script>
</body>
</html> |
Partager