Getting started
Resources
Flex
Spacing
Layout
Size
Typography
Background
Border
Transition
Utility classes for changing an element's text align property. Text align affects the text's vertical, and horizontal alignment within it's container.
Classes for text alignment are named using the format: [text]-[vertical]-[horizontal]
.
Where vertical includes:
upper
- for -unity-text-align: upper-[horizontal]
middle
- for -unity-text-align: middle-[horizontal]
lower
- for -unity-text-align: lower-[horizontal]
Where horizontal includes:
left
- for -unity-text-align: [vertical]-left
center
- for -unity-text-align: [vertical]-center
right
- for -unity-text-align: [vertical]-right
Class | Contents |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note that -unity-text-align: upper-left
is the default value for text align in Unity. Unless the value needs to be overridden from a parent, the text-upper-left
class is not needed.
UXML
UXML
By default, labels in Unity will grow to 100% width, but not height. Vertical alignment will not work if the label is not occupying enough vertical space.
UXML
On this page