Prev Demo
Textbaseline()
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Textbaseline</title> </head> <body> <canvas id="myCanvas" width="600" height="200"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.font = '30pt Calibri'; context.strokeStyle = 'orange'; context.textAlign = "center"; context.textBaseline = "middle"; context.strokeText('TECHFUNDA', 250, 100); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output