Created
April 11, 2013 11:29
-
-
Save mariiinda/5362655 to your computer and use it in GitHub Desktop.
canvas-quickstart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title></title> | |
| <meta name="description" content=""> | |
| <!--<link rel="stylesheet" href="css/style.css">--> | |
| <style> | |
| body { | |
| background: rgba(33, 33, 33, 0.3); | |
| margin: 0; | |
| padding:0; | |
| } | |
| #canvas { | |
| margin: 20px auto; | |
| display: block; | |
| padding: 0; | |
| box-shadow: 0px 0px 5px #CCC; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <canvas id='canvas' width='600' height='460'> | |
| Canvas not supported | |
| </canvas> | |
| <!--<script src="js/script.js"></script>--> | |
| <script> | |
| var canvas = document.querySelector('#canvas'); | |
| var context = canvas.getContext('2d'); | |
| context.font = "38pt Arial"; | |
| context.fillStyle = 'black'; | |
| context.fillText('Hello Canvas', canvas.width/2 - 150, canvas.height/2 +15); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment