HTML5 HelloWorld

参考写的html5 helloworld的代码:

 

<html>
<canvas id="myCanvas"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext("2d");
context.fillStyle = '#A6CAF0 ';
context.font = 'italic 30px sans-serif';
context.textBaseline='top';
context.fillText('Hello World!', 0, 0);
context.font = 'bold 30px sans-serif';
context.fillText('Hello world!', 0, 50);  
</script>
</html>

 

你可能感兴趣的:(html5)