The HTML canvas textAlign Property is used to set or return the current alignment for text content, according to the anchor point. Basically, the text will start at that position and the text will end at that specified position.
context.textAlign="center | end | left | right | start";
- start: It has a Default. The text starts at the specified position.
- end: The text ends at the specified position.
- left: It is used to set the text-alignment into left.
- right: It is used to set the text-alignment into right.
- center: It is used to set the text-alignment into the center.
Supported Browsers: The browsers supported by HTML canvas textAlign Property are listed below:
- Google Chrome
- Internet Explorer 9.0
- Apple Safari
- HTML | DOM Style textAlign Property
- HTML | canvas shadowOffsetX Property
- HTML | canvas lineCap Property
- HTML | canvas shadowColor Property
- HTML | canvas lineJoin Property
- HTML | canvas lineWidth Property
- HTML | canvas fillStyle Property
- HTML | canvas font Property
- HTML | canvas shadowBlur Property
- HTML | canvas strokeStyle Property
- HTML | canvas shadowOffsetY Property
- HTML | canvas textBaseline Property
- Web HTMLCanvasElement API | Canvas Element width property
- HTML | canvas Tag
- HTML | Canvas Basics
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.