harmony 鸿蒙span

  • 2022-12-13
  • 浏览 (553)

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 &lt;color&gt; - No Font color of the modified text.
font-size &lt;length&gt; 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.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙JS Service Widget UI Components

harmony 鸿蒙Data Types

harmony 鸿蒙button

harmony 鸿蒙calendar

harmony 鸿蒙chart

harmony 鸿蒙clock

harmony 鸿蒙divider

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙progress

0  赞