openharmony 鸿蒙 js-service-widget-basic-span

2025-06-12 浏览 (1)

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

NameTypeDefault ValueMandatoryDescription
color<color>-NoFont color of the modified text.
font-size<length>16pxNoFont size of the modified text.
font-stylestringnormalNoFont style of the modified text. For details, see font-style of the <text> component.
font-weightnumber |stringnormalNoFont weight of the modified text. For details, see font-weight of the <text> component.
text-decorationstringnoneNoText decoration of the modified text. For details, see text-decoration of the <text> component.
font-familystringsans-serifNoFont 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 鸿蒙JavaScript Service Widget UI Components

harmony 鸿蒙Data Types

harmony 鸿蒙button

harmony 鸿蒙calendar

harmony 鸿蒙chart

harmony 鸿蒙clock

harmony 鸿蒙divider

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙progress

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/kEdaDG