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 shadowOffsetY Property
- HTML | canvas shadowOffsetX Property
- HTML | canvas shadowBlur Property
- HTML | canvas font Property
- HTML | canvas strokeStyle Property
- HTML | canvas fillStyle Property
- HTML | canvas shadowColor Property
- HTML | canvas Tag
- HTML | DOM Canvas Object
- HTML | Canvas Basics
- HTML | canvas fillRect() Method
- HTML | canvas strokeRect() Method
- HTML | <canvas> height Attribute
- HTML | canvas rect() Method
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.