2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Align All Items Horizontally using justify-items
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Align All Items Horizontally using justify-items
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Problem Explanation
|
2018-10-30 21:36:48 -05:00
|
|
|
In this challenge you are required to use the "justify-items" property to horizontally align all the items in the grid.
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Hints
|
|
|
|
|
|
|
|
### Hint 1
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2018-10-30 21:36:48 -05:00
|
|
|
You can horizontally align the items by declaring the following in your CSS codeblock:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```css
|
2018-10-30 21:36:48 -05:00
|
|
|
justify-items: value;
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
2018-10-30 21:36:48 -05:00
|
|
|
|
|
|
|
where value is how you would like to horizontally align the items.
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-30 21:36:48 -05:00
|
|
|
|
|
|
|
Since the challenge requires you to horizontally center all the items, declare the following in your .container CSS codeblock:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```css
|
2018-10-30 21:36:48 -05:00
|
|
|
justify-items: center;
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
|
|
|
</details>
|