Fixed
Fixed
uses position:fixed
to place elements on the corners of the stacking context (usually the viewport).
-->
Fixed
uses position:fixed
to place elements on the corners of the stacking context (usually the viewport).
Use Fixed-
a corner and you’ll get an element with fixed position on that side.
Text rotation not included. Rotate text with Writing
Instead of specifying a corner, you just specify a side with Fixed-*
.
Just use Fixed-overlay
or Fixed-center
to get these two layouts. Is there anything esaier than this?
If you use --nudge
, you will move all fixed elements towards the center of the container.
Fixed
lets you place elements relative to the sides of a stacking context (usually the viewport).
To use Fixed
, just choose one of the directional classes and apply it to the element.
There are three top
positions.
Fixed-topleft
: Place content at the top leftFixed-top
: Place content at the top, spanning the full widthFixed-topright
: Place content at the top rightThere are three bottom
positions.
Fixed-bottomleft
: Place content at the bottom leftFixed-bottom
: Place content at the bottom, spanning the full widthFixed-bottomright
: Place content at the bottom rightThere are three left
positions.
Fixed-lefttop
: Place content at the left topFixed-left
: Place content at the left, spanning the full heightFixed-leftbottom
: Place content at the left bottomThere are three right
positions.
Fixed-righttop
: Place content at the right topFixed-right
: Place content at the right, spanning the full heightFixed-rightbottom
: Place content at the right bottomYou can use Fixed-center
to place an element in the center of the screen.
You can use Fixed-overlay
to create an overlay over the entire screen.
You can nudge any Fixed
element towards the center with --nudge
. Unlike Pos
, Fixed
does not calculate inner border radius when you --nudge
.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Fixed
lets you place elements relative to the sides of a stacking context (usually the viewport).
To use Fixed
, just choose one of the directional classes and apply it to the element.
There are three top
positions.
Fixed-topleft
: Place content at the top leftFixed-top
: Place content at the top, spanning the full widthFixed-topright
: Place content at the top rightThere are three bottom
positions.
Fixed-bottomleft
: Place content at the bottom leftFixed-bottom
: Place content at the bottom, spanning the full widthFixed-bottomright
: Place content at the bottom rightThere are three left
positions.
Fixed-lefttop
: Place content at the left topFixed-left
: Place content at the left, spanning the full heightFixed-leftbottom
: Place content at the left bottomThere are three right
positions.
Fixed-righttop
: Place content at the right topFixed-right
: Place content at the right, spanning the full heightFixed-rightbottom
: Place content at the right bottomYou can use Fixed-center
to place an element in the center of the screen.
You can use Fixed-overlay
to create an overlay over the entire screen.
You can nudge any Fixed
element towards the center with --nudge
. Unlike Pos
, Fixed
does not calculate inner border radius when you --nudge
.
This is the CSS for Fixed
.
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
This is the CSS for Fixed
.
Class | Description |
---|---|
Fixed-topleft | Place content at the top left corner |
Fixed-top | Place content at the top, spanning the full width |
Fixed-topright | Place content at the top right corner |
Fixed-bottomleft | Place content at the bottom left corner |
Fixed-bottom | Place content at the bottom, spanning the full width |
Fixed-bottomright | Place content at the bottom right corner |
Fixed-lefttop | Place content at the left top corner |
Fixed-left | Place content at the left, spanning the full height |
Fixed-leftbottom | Place content at the left bottom corner |
Fixed-righttop | Place content at the right top corner |
Fixed-right | Place content at the right, spanning the full height |
Fixed-rightbottom | Place content at the right bottom corner |
Fixed-overlay | Creates an overlay |
Fixed-center | Place content in the center of the overlay |
Variable | Default | Description |
---|---|---|
--nudge | 0 | Amount to push towards the center on both block and inline axis |
--nudge-x | 0 | Amount to push towards the center on the inline axis |
--nudge-y | 0 | Amount to push towards the center on the block axis |
Splendid Labz is free because we love developers and we want to contribute back to the ecosystem.
We only charge for access to the documentation to keep the project going. If you don't wish to pay, feel free to use the content from the features tab, our blogs or our videos as your guide.
Class | Description |
---|---|
Fixed-topleft | Place content at the top left corner |
Fixed-top | Place content at the top, spanning the full width |
Fixed-topright | Place content at the top right corner |
Fixed-bottomleft | Place content at the bottom left corner |
Fixed-bottom | Place content at the bottom, spanning the full width |
Fixed-bottomright | Place content at the bottom right corner |
Fixed-lefttop | Place content at the left top corner |
Fixed-left | Place content at the left, spanning the full height |
Fixed-leftbottom | Place content at the left bottom corner |
Fixed-righttop | Place content at the right top corner |
Fixed-right | Place content at the right, spanning the full height |
Fixed-rightbottom | Place content at the right bottom corner |
Fixed-overlay | Creates an overlay |
Fixed-center | Place content in the center of the overlay |
Variable | Default | Description |
---|---|---|
--nudge | 0 | Amount to push towards the center on both block and inline axis |
--nudge-x | 0 | Amount to push towards the center on the inline axis |
--nudge-y | 0 | Amount to push towards the center on the block axis |