# Span (/examples/widgets/span)



Rich text container where each `lv_span_t` segment can carry its own style, enabling mixed formatting within one paragraph.

Styled spans with click hit-test [#styled-spans-with-click-hit-test]

<LvglExampleBrief>
  Stack multiple styled spans in one group and log the clicked segment.
</LvglExampleBrief>

A centered `lv_spangroup` of width 300 and `LV_SIZE_CONTENT` height is styled
with an orange 1 px border and 20 px indent, and uses
`LV_SPAN_OVERFLOW_CLIP`. Five spans add text with per-segment color,
`LV_TEXT_DECOR_UNDERLINE`, `LV_TEXT_DECOR_STRIKETHROUGH`, reduced opacity, and
alternate fonts. A `LV_EVENT_CLICKED` handler resolves the clicked point to a
span via `lv_spangroup_get_span_by_point` and logs its text.

<LvglExample name="lv_example_span_1" path="widgets/span/lv_example_span_1" />
