Skip to content

Alignment Utilities

The alignment utilities provide a set of classes to adjust the align-content, align-items, and align-self properties of elements.

Align content

Class NamePropertyValue
.align-content-normalalign-contentnormal
.align-content-startalign-contentflex-start
.align-content-endalign-contentflex-end
.align-content-centeralign-contentcenter
.align-content-betweenalign-contentspace-between
.align-content-aroundalign-contentspace-around
.align-content-evenlyalign-contentspace-evenly
.align-content-baselinealign-contentbaseline
.align-content-stretchalign-contentstretch

.align-content-normal

Sets the align-content property to normal.

Item
Item
Item
html
<div class="display-grid align-content-normal">
  <!-- Content here -->
</div>

.align-content-start

Sets the align-content property to flex-start.

Item
Item
Item
html
<div class="display-grid align-content-start">
  <!-- Content here -->
</div>

.align-content-end

Sets the align-content property to flex-end.

Item
Item
Item
html
<div class="display-grid align-content-end">
  <!-- Content here -->
</div>

.align-content-center

Sets the align-content property to center.

Item
Item
Item
html
<div class="display-grid align-content-center">
  <!-- Content here -->
</div>

.align-content-between

Sets the align-content property to space-between.

Item
Item
Item
html
<div class="display-grid align-content-between">
  <!-- Content here -->
</div>

.align-content-around

Sets the align-content property to space-around.

Item
Item
Item
html
<div class="display-grid align-content-around">
  <!-- Content here -->
</div>

.align-content-evenly

Sets the align-content property to space-evenly.

Item
Item
Item
html
<div class="display-grid align-content-evenly">
  <!-- Content here -->
</div>

.align-content-baseline

Sets the align-content property to baseline.

Item
Item
Item
html
<div class="display-grid align-content-baseline">
  <!-- Content here -->
</div>

.align-content-stretch

Sets the align-content property to stretch.

Item
Item
Item
html
<div class="display-grid align-content-start">
  <!-- Content here -->
</div>

Align items

Class NamePropertyValue
.align-items-startalign-itemsstart
.align-items-endalign-itemsend
.align-items-centeralign-itemscenter
.align-items-baselinealign-itemsbaseline
.align-items-stretchalign-itemsstretch

.align-items-start

Sets the align-items property to start.

Item
Item
Item
html
<div class="display-flex align-items-start">
  <!-- Content here -->
</div>

.align-items-end

Sets the align-items property to end.

Item
Item
Item
html
<div class="display-flex align-items-end">
  <!-- Content here -->
</div>

.align-items-center

Sets the align-items property to center.

Item
Item
Item
html
<div class="display-flex align-items-center">
  <!-- Content here -->
</div>

.align-items-baseline

Sets the align-items property to baseline.

Item
Item
Item
html
<div class="display-flex align-items-baseline">
  <!-- Content here -->
</div>

.align-items-stretch

Sets the align-items property to stretch.

Item
Item
Item
html
<div class="display-flex align-items-stretch">
  <!-- Content here -->
</div>

Align self

Class NamePropertyValue
.align-self-autoalign-selfauto
.align-self-startalign-selfstart
.align-self-endalign-selfend
.align-self-centeralign-selfcenter
.align-self-baselinealign-selfbaseline
.align-self-stretchalign-selfstretch

.align-self-auto

Sets the align-self property to auto.

Item
html
<div class="display-flex">
  <div class="align-self-auto">
    <!-- Content here -->
  </div>
</div>

.align-self-start

Sets the align-self property to start.

Item
html
<div class="display-flex">
  <div class="align-self-start">
    <!-- Content here -->
  </div>
</div>

.align-self-end

Sets the align-self property to end.

Item
html
<div class="display-flex">
  <div class="align-self-end">
    <!-- Content here -->
  </div>
</div>

.align-self-end

Sets the align-self property to end.

Item
html
<div class="display-flex">
  <div class="align-self-end">
    <!-- Content here -->
  </div>
</div>

.align-self-center

Sets the align-self property to center.

Item
html
<div class="display-flex">
  <div class="align-self-center">
    <!-- Content here -->
  </div>
</div>

.align-self-baseline

Sets the align-self property to baseline.

Item
html
<div class="display-flex">
  <div class="align-self-baseline">
    <!-- Content here -->
  </div>
</div>

.align-self-stretch

Sets the align-self property to stretch.

Item
html
<div class="display-flex">
  <div class="align-self-stretch">
    <!-- Content here -->
  </div>
</div>

Customization

To customize the alignment utilities, you can use the following variables.

VariableDefault ValueDescription
$selector-base"."The base selector for the utility classes.
$use-importanttrueA flag to determine if the !important flag should be added to the utility classes.
$screen-awarefalseA flag to generate screen-aware utility classes.
$theme-awarefalseA flag to generate theme-aware utility classes.
$state-awarefalseA flag to generate state-aware utility classes.
$screen-aware-separator":"The separator for screen-aware utility classes.
$theme-aware-separator":"The separator for theme-aware utility classes.
$state-aware-separator":"The separator for state-aware utility classes.
$align-content-selector-prefix"align-content-"The prefix for the align content utility classes.
$custom-align-content-properties()The custom properties and values for the align content utility classes.
$align-items-selector-prefix"align-items-"The prefix for the .align-items-utility utility classes.
$custom-align-items-properties()The custom properties and values for the .align-items-utility utility classes.
$align-self-selector-prefix"align-self-"The prefix for the .align-self-utility utility classes.
$custom-align-self-properties()The custom properties and values for the .align-self-utility utility classes.

Responsive variants

To generate responsive alignment utilities, you can set the $screen-aware, $theme-aware, or $state-aware variables to true.

By default, no responsive alignment utilities are generated.

✏️ Note

For more information on responsive variants, refer to the Responsive utility classes documentation.