# Text

The `<text>` can be used whenever you want to display some text.

Content within `<text>` can contain some formatting tags like `<b>`, `<i>` or `<u>` and can use `<br/>` for force a new line.

It can be used both within [`<body>`](/document-xml-adx/adx-elements/body.md) and within [`<template>`](/document-xml-adx/adx-elements/template.md).

## Examples

```xml
<body ...>
  ...
  <text class="h1" spaceAfter="10">
    Hello World!!!<br/>
    <b>bold</b>
    <i>italic</i><br/>
    <u>underlined</u>
  </text>
</body>
```

```markup
<template ...>
  ...
  <text
    bottom="12mm"
    left="0"
    width="200mm"
    height="10mm"
    fontSize="8"
    align="center"
  >
    Atfinity AG, Elias-Canetti-Strasse 7, 8050 Zürich, Switzerland
  </text>
  ...
</template>
```

## Attributes

#### `left`

If used within `<template>` this is the distance from the left border of the document, this can be in pt, mm or cm, e.g. `left="20mm"`. Ignored when used in `<body>`.

#### `bottom`

If used within a template this is the distance from the bottom border of the document, this can be in pt, mm or cm, e.g. `bottom="20mm"`. Ignored when used in `<body>`.

#### `width`

Required when used in `<template>` context. The width of the text block, in pt, mm or cm.

#### `height`

Required when used in `<template>` context. The height of the text block, in pt, mm or cm.

#### `class` (optional)

The styleclass to use to display content.

#### `color` (optional)

A color in either plain text html color (e.g. `red`, `white`, `black`) or as an rgb value, e.g. `rgb(255, 10, 10)`.

#### `fontSize` (optional)

The font size in pt, mm or cm (e.g. `fontSize="12"`). Overrides the size defined by `class`.

#### `align` (optional)

Text alignment: `left`, `right`, `center`, or `justify`.

#### `spaceBefore` (optional)

Space in point to add before the element.

#### `spaceAfter` (optional)

Space in point to add after the element.

<details>

<summary></summary>

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/document-xml-adx/adx-elements/text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
