html
html
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
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script type="text/javascript">
window.onload = function () {
var canvas=
document.getElementById("canvasArea");
var context = canvas.getContext("2d");
// MESSAGE details centered on canvas.
var mText = "Hi!"
var xPos = canvas.width/2;
var yPos = canvas.height/2;
// TEXT format details.
context.font = "80pt Comic Sans MS"; context.fillStyle = "lime"; context.textAlign = "center"; context.textBaseline = "middle";
// FILL text.
context.fillText(mText, xPos, yPos);
}
</script>
</head>
<body>
<canvas id="canvasArea"
width="300" height="400"
style="border:1px solid black">
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run