# IHTMLCSSStyleDeclaration::textAnchor Property

Gets or sets a value that aligns a string of text relative to a given point.

Syntax

```
HRESULT IHTMLCSSStyleDeclaration::get_textAnchor(BSTR *p);HRESULT IHTMLCSSStyleDeclaration::put_textAnchor(BSTR v);
```

Parameters

p
Pointer to a variable of type BSTR that receives one of the values listed in Possible Values.
v
BSTR that specifies one of the values listed in Possible Values.

Possible Values

 start Default. The rendered characters are aligned such that the start of the text string is at the initial current text position. For Latin scripts in their usual orientation, this is equivalent to left alignment. For scripts that are inherently right-to-left such, as Hebrew and Arabic, this is equivalent to right alignment. For Asian text that has a vertical primary text direction, this is comparable to top alignment. middle The rendered characters are aligned such that the middle of the text string is at the current text position. (For text on a path, conceptually the text string is first laid out in a straight line. The midpoint between the start of the text string and the end of the text string is determined. Then, the text string is mapped onto the path with this midpoint placed at the current text position.) end The rendered characters are aligned such that the end of the text string is at the initial current text position.For Latin scripts in their usual orientation, this is equivalent to right alignment. For scripts that are inherently right-to-left such as Hebrew and Arabic, this is equivalent to left alignment.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The IHTMLCSSStyleDeclaration::textAnchor property is applied to each individual text chunk within a given text element. (A text chunk is defined by an absolute position adjustment, or an adjustment to the current text position.) Each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from one of the following, depending on context:

• the application of the `x` and `y` attributes on the text element
• any `x` or `y` attribute values on a tSpan element assigned explicitly to the first rendered character in a text chunk
• determination of the initial current text position for a textPath element