--- title: Flexbox status: New release source: /app/assets/stylesheets/primer-core/utilities/lib/layout.scss status_issue: https://github.com/github/design-systems/issues/157 --- Flex utilities can be used to apply `flexbox` behaviors to elements by using utility classes. {:toc} ## Required reading Before using these utilities, **you should be familiar with CSS3 Flexible Box spec**. If you are not, check out MDN's guide: :book: **[Using CSS Flexible Boxes](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes)** ## Flex container Use these classes to make an element lay out its content using the flexbox model. Each **direct** child of the flex container will become a flex item. #### CSS ```css .d-flex { display: flex; } .d-inline-flex { display: inline-flex; } ``` #### Classes | Class | Description | | --- | --- | | `.d-flex` | The element behaves like a block and lays out its content using the flexbox model. | | `.d-inline-flex` | The element behaves like an inline element and lays out its content using the flexbox model. | #### Example using `.d-flex` ```html
Body Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.
Body Bacon ipsum dolor sit amet chuck prosciutto landjaeger ham hock filet mignon shoulder hamburger pig venison.