# `<span>`

[Canonical page](https://nothing.graphics/docs/format/reference/span) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/reference/span.md)

Own a stable text range with optional local style and copy keys.



<!-- Generated by ncf/tools/reference/generate.mjs. -->

A span keeps its authored range through reflow. Nested spans inherit each font field from the nearest specified ancestor independently.

## Syntax [#syntax]

### Keep one word bold and colored [#keep-one-word-bold-and-colored]

Apply weight 700 and a local fill to the same text range. At frame 24 the leaf span reads WAIT. The trailing period stays outside this range and uses the surrounding regular face and fill.

```xml
<span font-weight="700">READY<fill><paint><solid color="#2060E0FF">
    <animate attributeName="color" fill="freeze">
      <key frame="0" value="#2060E0FF" ease="linear"/>
      <key frame="24" value="#60C080FF"/>
    </animate>
  </solid></paint></fill><animate attributeName="value" fill="freeze">
    <key frame="0" value="READY" ease="hold"/>
    <key frame="24" value="WAIT"/>
  </animate></span>
```

[Complete .nothing source](https://github.com/gridaco/nothing/blob/main/ncf/examples/composition-card.nothing) · [Sample checks](https://github.com/gridaco/nothing/blob/main/ncf/conformance/composition-card.md)

## Usage context [#usage-context]

Allowed parents are [`<text>`](https://nothing.graphics/docs/format/reference/text), [`<span>`](https://nothing.graphics/docs/format/reference/span).

Includes [Text copy](https://nothing.graphics/docs/format/reference/text-copy).

Literal copy, including spaces beside elements, is significant. A span's paint boundary does not break shaping. Diagnose a shaped cluster crossing differently assigned fills. [Span appearance](https://nothing.graphics/docs/format/spec/text#appearance-and-editing)

## Attributes [#attributes]

[Property animation](https://nothing.graphics/docs/format/spec/animation#property-types-and-exceptions)

### `font-family` [#font-family]

**Value** `One nonempty family name` · **If omitted** `inherit sampled family` · **Keys** Held

Override the requested family on this range. [Authored font requests](https://nothing.graphics/docs/format/spec/fonts#authored-request)

### `font-size` [#font-size]

**Value** local units · **If omitted** `inherit sampled size` · **Keys** Scalar

Override this range's positive em size. [Typeface and paragraph](https://nothing.graphics/docs/format/spec/text#typeface-and-paragraph)

### `font-weight` [#font-weight]

**Value** `Exact integer from 1 to 1000` · **If omitted** `inherit sampled weight` · **Keys** Held

Override the requested face weight on this range. [Authored font requests](https://nothing.graphics/docs/format/spec/fonts#authored-request)

## Animation-only targets [#animation-only-targets]

[Property animation](https://nothing.graphics/docs/format/spec/animation#property-types-and-exceptions)

### `value` [#value]

**Value** `Literal Unicode character data` · **If omitted** `direct character data` · **Keys** Held · **Declared by** [Text copy](https://nothing.graphics/docs/format/reference/text-copy#value)

Replace the copy at the key's time. In an XML key value, write LF and tab as character references. A track requires an owner with no child spans. The base is the concatenated direct character data after XML processing.

## Children [#children]

| Elements                                                              | Cardinality           | Declared by | Role and source order                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------- | --------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`<span>`](https://nothing.graphics/docs/format/reference/span)       | Zero or more          | `<span>`    | Nested text ranges. Document order interleaved with literal character data.                                                                                                                                                                                                                  |
| [`<fill>`](https://nothing.graphics/docs/format/reference/fill)       | Optional, at most one | `<span>`    | Local paint stack. When absent, use the nearest enclosing span fill or the shape fill. Apply stacks in their owning spans' preorder, after the shape fill and before the shape strokes. [Span appearance and editing](https://nothing.graphics/docs/format/spec/text#appearance-and-editing) |
| [`<animate>`](https://nothing.graphics/docs/format/reference/animate) | Zero or more          | Animation   | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)                                                                         |

## Specifications [#specifications]

* [Text content and ownership](https://nothing.graphics/docs/format/spec/text#content-and-ownership)
* [Authored font requests](https://nothing.graphics/docs/format/spec/fonts#authored-request)
* [Typeface and paragraph](https://nothing.graphics/docs/format/spec/text#typeface-and-paragraph)
* [Span appearance and editing](https://nothing.graphics/docs/format/spec/text#appearance-and-editing)
* [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)
