harmony 鸿蒙span

  • 2022-10-28
  • 浏览 (486)

span

作为<text>子组件提供文本修饰能力。

说明:

从API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。

子组件

支持子组件<span>

属性

支持通用属性

样式

名称 类型 默认值 必填 描述
color &lt;color&gt; - 设置文本段落的文本颜色。
font-size &lt;length&gt; 16px 设置文本段落的文本尺寸。
font-style string normal 设置文本段落的字体样式,见text组件font-style的样式属性
font-weight number&nbsp;|&nbsp;string normal 设置文本段落的字体粗细,见text组件font-weight的样式属性
text-decoration string none 设置文本段落的文本修饰,见text组件text-decoration样式属性
font-family string sans-serif 设置文本段落的字体列表,用逗号分隔,每个字体用字体名或者字体族名设置。列表中第一个系统中存在的或者通过自定义字体指定的字体,会被选中作为文本的字体。

事件

不支持。

示例

详见text示例

你可能感兴趣的鸿蒙文章

harmony 鸿蒙JS服务卡片UI组件

harmony 鸿蒙数据类型说明

harmony 鸿蒙button

harmony 鸿蒙calendar

harmony 鸿蒙chart

harmony 鸿蒙clock

harmony 鸿蒙divider

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙progress

0  赞