例
異なる textBasline 配置を使用してテキストを記述します:
JavaScript:
...
ctx.textBaseline="bottom";
ctx.fillText("Bottom",10,50);
ctx.textBaseline="middle";
ctx.fillText("Middle",97,50);
ctx.textBaseline="top";
ctx.fillText("Top",175,50);
...
Try it yourself »
textBaseline 属性は、主要な全ブラウザがサポートしていますが、特に "hanging" と
"ideographic" の値を使用する場合は、いくつかの相違点があります。