span

The <span> component is a child component of <text> and is used as a text modifier.

NOTE

The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.

Child Components

The child component <span> is supported.

attributes

The universal attributes are supported.

Styles

Name Type Default Value Mandatory Description
color <color> - No Font color of the modified text.
font-size <length> 16px No Font size of the modified text.
font-style string normal No Font style of the modified text. For details, see font-style of the <text> component.
font-weight number | string normal No Font weight of the modified text. For details, see font-weight of the <text> component.
text-decoration string none No Text decoration of the modified text. For details, see text-decoration of the <text> component.
font-family string sans-serif No Font family, in which fonts are separated by commas (,). Each font is set using a font name or font family name. The first font in the family or the specified custom font is used for the text.

Events

Not supported

Example

For details, see Example of the <text> component.