- <html>
- <head>
- <title>Canvas</title>
- <style type="text/css">
- #canvasSection{ position:fixed;}
- </style>
- <script type="text/javascript">
- function draw()
- {
- var canvas = document.getElementById('canvasSection');
- var context = canvas.getContext('2d');
- context.fillStyle = '#FF0000';
- context.fillRect(0, 0,50,50);
- context.textBaseline = 'top';
- context.font = 'bold 30px sans-serif';
- context.strokeText('Canvas', 0, 0);
- context.fillStyle = '#0000FF';
- context.fillRect(100, 0,50,50);
- }
- </script>
- </head>
- <body onLoad="draw()">
- <canvas id="canvasSection">Error, canvas is not supported</canvas>
- <h1>ueberschrift</h1>
- </body>
- </html>