Use shorthand position utility classes to quickly change an elements position value.
Position utility classes can be defined using the format -position-{viewport}--{value}
.
Viewports supported are sm
, md
, lg
, and xl
.
Use to set an elements position on all viewports.
<div class="-position--static"></div>
<div class="-position--relative"></div>
<div class="-position--fixed"></div>
<div class="-position--absolute"></div>
<div class="-position--sticky"></div>
To target a specific viewport, add the viewport abbreviation to the class. It's important to note that viewport-specific classes apply to their respective viewport and any larger viewport (unless overridden by a larger viewport class).
<div class="-position-sm--static"></div>
<div class="-position-md--static"></div>
<div class="-position-lg--static"></div>
<div class="-position-xl--static"></div>
<div class="-position-sm--relative"></div>
<div class="-position-md--relative"></div>
<div class="-position-lg--relative"></div>
<div class="-position-xl--relative"></div>
<div class="-position-sm--fixed"></div>
<div class="-position-md--fixed"></div>
<div class="-position-lg--fixed"></div>
<div class="-position-xl--fixed"></div>
<div class="-position-sm--absolute"></div>
<div class="-position-md--absolute"></div>
<div class="-position-lg--absolute"></div>
<div class="-position-xl--absolute"></div>
<div class="-position-sm--sticky"></div>
<div class="-position-md--sticky"></div>
<div class="-position-lg--sticky"></div>
<div class="-position-xl--sticky"></div>