Canvas Tutorials

Canvas Methods and Properties

HTML canvas strokeText() Method

HTML canvas strokeText() Method



The strokeText() method is used to draw text without fill on the canvas.


Default Value:-


Its default color is black.




Its syntax is:- context.strokeText(text, x, y, maxWidth);


Further Explanation:-


Parameter Description
text Specifies the text that will be written on the canvas
x The x-coordinate is where to start painting the text.
y The y-coordinate is where to start painting the text.
maxWidth Optional. The maximum allowed width of the text, in pixels

Code Explanation

All Tutorials related to Canvas Methods and Properties

All Sections related to Canvas