mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
1.1 KiB
1.1 KiB
| extends | title |
|---|---|
| _layouts.markdown | Position |
Position
The position utilities are primarily position property helpers.
<!-- Using the utilities in HTML: -->
<div class="fixed"></div>
<div class="absolute"></div>
<div class="relative"></div>
// Using the utilities in Less:
div {
.fixed;
.absolute;
.relative;
}
Pinning absolute content
Tailwind also provides pin utilties, useful for "pinning" absolutely positioned elements using the top, right, bottom and left properties.
<!-- Using the utilities in HTML: -->
<div class="relative">
<div class="absolute pin-t"></div>
</div>
// Using the utilities in Less:
div {
.pin;
.pin-t;
.pin-r;
.pin-b;
.pin-l;
.pin-x;
.pin-y;
}
Responsive
The position utitlies can also be used with responsive prefixes:
<!-- Using the utilities in HTML: -->
<div class="fixed sm:absolute md:relative"></div>
// Using the utilities in Less:
div {
.screen(md, {
.relative;
});
}