>- This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>- The text content must be written in the content area. The **tspan** sub-element label can be nested to segment the text content. The **textPath** sub-element label can be nested to draw the text content based on the specified path.
>- **<text\>** can be nested only by the parent element label **svg**.
>- Only the default font **sans-serif** is supported.
> - This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The text content must be written in the content area. The **tspan** sub-element label can be nested to segment the text content. The **textPath** sub-element label can be nested to draw the text content based on the specified path.
>
> - **\<text>** can be nested only by the parent element label **svg**.
>
> - Only the default font **sans-serif** is supported.
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="a1a1731af05554f119fa365748f276bb2"><aname="a1a1731af05554f119fa365748f276bb2"></a><aname="a1a1731af05554f119fa365748f276bb2"></a>Unique ID of the component.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p62121758111517"><aname="p62121758111517"></a><aname="p62121758111517"></a>X-coordinate of the upper left corner of the component.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p125961416161611"><aname="p125961416161611"></a><aname="p125961416161611"></a>Y-coordinate of the upper left corner of the component.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p78950185420"><aname="p78950185420"></a><aname="p78950185420"></a>Offset of the text on the x-axis.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p107241750205414"><aname="p107241750205414"></a><aname="p107241750205414"></a>Offset of the text on the y-axis.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p34692079335"><aname="p34692079335"></a><aname="p34692079335"></a>Rotates the lower left corner of the font based on the circle center. A positive number indicates clockwise rotation, and a negative number indicates counterclockwise rotation.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p354275835511"><aname="p354275835511"></a><aname="p354275835511"></a>Font fill color.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p19543058195511"><aname="p19543058195511"></a><aname="p19543058195511"></a>Font fill opacity.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="aa0471c31e05e465aa9c42312b9ab9f6f"><aname="aa0471c31e05e465aa9c42312b9ab9f6f"></a><aname="aa0471c31e05e465aa9c42312b9ab9f6f"></a>Opacity of an element. The value ranges from <strongid="b20788312163913"><aname="b20788312163913"></a><aname="b20788312163913"></a>0</strong> to <strongid="b2789412193917"><aname="b2789412193917"></a><aname="b2789412193917"></a>1</strong>. The value <strongid="b1978901216398"><aname="b1978901216398"></a><aname="b1978901216398"></a>1</strong> means opaque, and <strongid="b18790171213917"><aname="b18790171213917"></a><aname="b18790171213917"></a>0</strong> means completely transparent. Attribute animations are supported.</p>
<tdclass="cellrowborder"valign="top"width="35.76%"headers="mcps1.1.6.1.5 "><pid="p1543145845514"><aname="p1543145845514"></a><aname="p1543145845514"></a>Stroke and stroke color.</p>
| id | string | - | No | Unique ID of the component. |
| x | <length>\|<percentage> | 0 | No | X-coordinate of the upper left corner of the component. |
| y | <length>\|<percentage> | 0 | No | Y-coordinate of the upper left corner of the component. |
| dx | <length>\|<percentage> | 0 | No | Offset of the text on the x-axis. |
| dy | <length>\|<percentage> | 0 | No | Offset of the text on the y-axis. |
| rotate | number | 0 | No | Rotation of the text around its lower left corner. A positive number indicates clockwise rotation, and a negative number indicates counterclockwise rotation. |
| font-size | <length> | 30px | No | Font size. |
| fill | <color> | black | No | Fill color of the text. |
| fill-opacity | number | 1.0 | No | Fill opacity of the text. |
| opacity | number | 1 | No | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. Attribute animations are supported.|
| stroke | <color> | black | No | Stroke and stroke color. |
| stroke-width | number | 1px | No | Stroke width. |
| stroke-opacity | number | 1.0 | No | Stroke opacity. |
## Example
```css
/* xxx.css */
.container{
flex-direction:row;
...
...
@@ -192,7 +56,7 @@ The attributes in the following table are supported.
}
```
```
```html
<!-- xxx.hml -->
<divclass="container">
<svg>
...
...
@@ -202,7 +66,7 @@ The attributes in the following table are supported.