---
title: textBaseline
framework: webkitjs
role: symbol
role_heading: Instance Property
path: webkitjs/canvasrenderingcontext2d/1629692-textbaseline
---

# textBaseline

A string that specifies how the bounding box aligns vertically relative to the y-coordinate.

## Declaration

```data
attribute DOMString textBaseline;
```

## Discussion

Discussion The y-coordinate of a line of text corresponds to the point on the text glyphs specified by textBaseline. Possible values are top, hanging, middle, alphabetic (default), ideographic, and bottom. The position of each value on the text glyphs is illustrated in Figure 1.

See textBaseline Constants for descriptions of the constants.

## See Also

### Drawing Text

- [fillText](webkitjs/canvasrenderingcontext2d/1634243-filltext.md)
- [font](webkitjs/canvasrenderingcontext2d/1632249-font.md)
- [measureText](webkitjs/canvasrenderingcontext2d/1631690-measuretext.md)
- [strokeText](webkitjs/canvasrenderingcontext2d/1630188-stroketext.md)
- [textAlign](webkitjs/canvasrenderingcontext2d/1631811-textalign.md)
