Skip to main content

Position

Set the positioning of an element.

View as Markdown
baselinewidely
ClassCSS
p:aposition: absolute;
p:fposition: fixed;
p:rposition: relative;
p:sposition: static;
p:stposition: sticky;

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:p:r.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:p:rFrom 32rem up.
@sm:p:rFrom 40rem up.
@md:p:rFrom 48rem up.
@lg:p:rFrom 64rem up.
@xl:p:rFrom 80rem up.
@xxl:p:rFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:p:rContainer from 32rem up.
@c:sm:p:rContainer from 40rem up.
@c:md:p:rContainer from 48rem up.
@c:lg:p:rContainer from 64rem up.
@c:xl:p:rContainer from 80rem up.
@c:xxl:p:rContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:p:rOn a touch screen.
@prm:p:rWith reduced motion on.
@st:p:rOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:p:rOn :hover.
f:p:rOn :focus.
fv:p:rOn :focus-visible.
a:p:rOn :active.
d:p:rOn :disabled.
fc:p:rOn :first-child.
c:p:rOn :checked.
e:p:rOn :empty.
fw:p:rOn :focus-within.
i:p:rOn :invalid.
in:p:rOn :indeterminate.
lc:p:rOn :last-child.
nc:p:rOn :nth-child.
r:p:rOn :required.
ro:p:rOn :read-only.
v:p:rOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::p:rOn ::after.
b::p:rOn ::before.
p::p:rOn ::placeholder.
s::p:rOn ::selection.