--- name: layout-inset description: Controlling placement of positioned elements with top, right, bottom, left, and inset utilities --- # Top / Right / Bottom / Left Utilities for controlling the placement of positioned elements. ## Usage ### Basic positioning Use `top-`, `right-`, `bottom-`, `left-` to position elements: ```html
01
02
05
``` ### Inset utilities Use `inset-` for all sides, `inset-x-` for horizontal, `inset-y-` for vertical: ```html
Fill parent
Span top
Span left
``` ### Negative values Prefix with a dash for negative values: ```html
``` ### Logical properties Use `start-` and `end-` for RTL-aware positioning: ```html
Left in LTR
Right in RTL
``` ### Percentage and custom values Use fractions for percentages or arbitrary values: ```html
Centered
Custom position
``` ## Key Points - `inset-0` sets all sides to 0 (equivalent to `top-0 right-0 bottom-0 left-0`) - `inset-x-0` sets left and right to 0 - `inset-y-0` sets top and bottom to 0 - Use `start`/`end` for logical properties that adapt to text direction - Negative values use dash prefix: `-top-4`, `-left-8` - Combine with `position` utilities (`absolute`, `fixed`, `relative`, `sticky`)