--- id: 587d78ac367417b2b2512af6 title: Align Elements Using the justify-content Property challengeType: 0 videoUrl: 'https://scrimba.com/p/pVaDAv/c43gnHm' forumTopicId: 301102 dashedName: align-elements-using-the-justify-content-property --- # --description-- Sometimes the flex items within a flex container do not fill all the space in the container. It is common to want to tell CSS how to align and space out the flex items a certain way. Fortunately, the `justify-content` property has several options to do this. But first, there is some important terminology to understand before reviewing those options. [Here is a useful image showing a row to illustrate the concepts below.](https://www.w3.org/TR/css-flexbox-1/images/flex-direction-terms.svg) Recall that setting a flex container as a row places the flex items side-by-side from left-to-right. A flex container set as a column places the flex items in a vertical stack from top-to-bottom. For each, the direction the flex items are arranged is called the **main axis**. For a row, this is a horizontal line that cuts through each item. And for a column, the main axis is a vertical line through the items. There are several options for how to space the flex items along the line that is the main axis. One of the most commonly used is `justify-content: center;`, which aligns all the flex items to the center inside the flex container. Other options include: # --instructions-- An example helps show this property in action. Add the CSS property `justify-content` to the `#box-container` element, and give it a value of `center`. **Bonus** Try the other options for the `justify-content` property in the code editor to see their differences. But note that a value of `center` is the only one that will pass this challenge. # --hints-- The `#box-container` element should have a `justify-content` property set to a value of `center`. ```js assert($('#box-container').css('justify-content') == 'center'); ``` # --seed-- ## --seed-contents-- ```html
``` # --solutions-- ```html
```