Text Styles
Text alignment
The text-align
key is used to align text horizontally within the text box.
It has the same function as the text-align
property in CSS.
The text can be aligned using the following keywords:
- center
-
Text is centered within the text box.
- justify
-
Text is spaced out to align evenly with both sides of the text box.
- left
-
Text is aligned to the left side of the text box.
- right
-
Text is aligned to the right side of the text box.
- inherit
-
Only applies to the caption text of block images (
image-caption
) and tables (table-caption
). The valueinherit
resolves to the alignment of the block. Further information about usinginherit
on image caption text and table caption text can be found on xref Block Image Styles and Table Styles, respectively.
The text-align
key is distinct from the similarly-named align
key.
The align key aligns a block element horizontally within its container.
Decoration
The text-decoration
key specifies the type of decoration, such as an underline, that is applied to the text.
It accepts the following keywords:
- line-through
-
A line is drawn across the text. This is commonly referred to as a strikethrough.
- none
-
Clears an inherited value and no decoration is applied to the text.
- underline
-
A line is drawn beneath the text.
When a key category allows the text-decoration
key to be set, you can usually specify a text-decoration-color
and text-decoration-width
, too.
Font style
The font-style
key specifies the font variant in a font family that the text should use.
The key accepts the following keywords:
- bold
-
Text is styled using the bold variant of a font family.
- bold_italic
-
Text is styled using the bold italic variant of a font family
- italic
-
Text is styled using the italic variant of a font family.
- normal
-
Text is styled using the normal font variant in a font family.
- normal_italic
-
The style of the text is reset to normal, and then the text is styled using the italic variant of a font family.
Usually, you can specify a font style wherever you can set a font family (font-family
).
The converter uses the values of both keys in combination to locate the correct font within a font stack.
Transform
The text-transform
key changes the case of the text.
It accepts the following keywords:
- capitalize
-
Transforms the first letter of each word to a capital letter.
- lowercase
-
Transforms all the text to lower case letters.
- none
-
Clears an inherited value and no case transformation is applied to the text.
- smallcaps
-
Replaces lowercase Latin letters with their small capital variant.
- uppercase
-
Transforms all the text to capital letters.
The text-transform
key can’t be set on the base category.