# freeCodeCamp Challenge Guide: Use the flex Shorthand Property

**URL:** <https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-use-the-flex-shorthand-property/301112>\
**Category:** freeCodeCamp Contributors\
**Tags:** guide\
**Created:** [August 3, 2019, 5:38am UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-use-the-flex-shorthand-property/301112 "2019-08-03T05:38:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![camperbot](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/camperbot/32/18364_2.png) [@camperbot](https://forum.freecodecamp.org/u/camperbot)\
**Post date:** [August 3, 2019, 5:38am UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-use-the-flex-shorthand-property/301112/1 "2019-08-03T05:38:26Z")

</div>

# [Use the flex Shorthand Property](https://www.freecodecamp.org/learn/responsive-web-design/css-flexbox/use-the-flex-shorthand-property)

* * *

## Problem Explanation

While you can set `flex-grow`, `flex-shrink`, and `flex-basis` properties individually. if you ever need to see the values for all of them you can do it in one line using the following format `flex: flex-grow flex-shrink flex-basis;`.

Example:

```css
#box-1 {
    background-color: dodgerblue;
    flex: 2 2 150px;
    height: 200px;
  }

```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 8, 2025, 3:59pm UTC](https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-use-the-flex-shorthand-property/301112/2 "2025-01-08T15:59:25Z")

</div>

Closed on January 8, 2025, 3:59pm UTC


