HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Canvas Object : Create a red line in position 150. Position 150 is the anchor point for all the text defined in the example below. Study the effect of each textAlign property value
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
textAlign | 4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
The textAlign property sets or returns the current alignment for text content, according to the anchor point.
Normally, the text will START in the position specified, however, if you set textAlign="right" and place the text in position 150, it means that the text should END in position 150.
Default value: | start |
---|---|
JavaScript syntax: | context.textAlign = "center|end|left|right|start"; |
Values | Description | Play it |
---|---|---|
start | Default. The text starts at the specified position | Play it » |
end | The text ends at the specified position | Play it » |
center | The center of the text is placed at the specified position | Play it » |
left | The text starts at the specified position | Play it » |
right | The text ends at the specified position | Play it » |
❮ Canvas Object