Getting started
Resources
Flex
Spacing
Layout
Size
Typography
Background
Border
Transition
Utility classes for changing an element's position property. Position affects how the element behaves within the parent container, and in relation to sibling elements in the UXML layout.
Classes for position are named using the format: [value]
.
Where value includes:
relative
- for position: relative
absolute
- for position: absolute
Class | Contents |
|
|
|
|
Note that position: relative
is the default value for position in Unity. Unless the value needs to be overridden from a parent, the relative
class is not needed.
Relative elements will respect spacing values (margin, and padding) of sibling/parent elements, and position itself relative to other sibling elements according to the parent's flex direction, justification, and alignment.
Parent
UXML
Absolute elements will respect spacing values (margin, and padding) of parent elements only (unless the position is altered), and position itself only according to the parent relative container.
Parent
UXML
On this page