Sets or retrieves the color behind the text in the object.
HRESULT IHTMLRenderStyle::get_textBackgroundColor(VARIANT *p);HRESULT IHTMLRenderStyle::put_textBackgroundColor(VARIANT v);
- Pointer to a variable of type VARIANT of type VT_BSTR or VT_I4 that receives one of the values listed in Possible Values.
- VARIANT of type VT_BSTR or VT_I4 that specifies one of the values listed in Possible Values.
undefined Default. Text background has no specified color. The value is set automatically; for instance, by default or inheritance. transparent No text background color is rendered; however any background color defined by Cascading Style Sheets (CSS) is still rendered. color Any color value, including those specified in the Color Table.
Returns S_OK if successful, or an error value otherwise.
There is only a difference between the
undefinedvalues when there are multiple style properties that apply to a single run of text. In this situation, the IHTMLRenderStyle::renderingPriority property determines which colors are applied. An
undefinedvalue does not participate in background color determination, regardless of its priority. A
transparentvalue only has an effect if it has the highest priority value—that is, if it is the text background color value that is ultimately applied to the given text run.
For instance, consider a style1 , with priority 1, which specifies red. Then consider a style2 , with priority 2, which specifies
undefined. If both styles are applied to the same run of text, red is ultimately used as the background color because style2 , even though it has a higher priority, is
undefinedand therefore has no effect.
Now consider a style3 , with priority 2, which specifies
transparent. If both style1 (defined in the previous paragraph) and style3 are applied to the same run of text, no additional background color is applied because style3 has a higher priority, so
transparentis applied instead of red. Of course, if color was applied via CSS, that color will appear.