2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Align an Item Horizontally using justify-self
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Align an Item Horizontally using justify-self
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Problem Explanation
|
2018-10-31 13:09:50 -05:00
|
|
|
In this challenge you are required to use the "justify-self" property to horizontally align a grid item.
|
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-31 13:09:50 -05:00
|
|
|
You can horizontally align an item by declaring the following in your CSS codeblock:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```css
|
2018-10-31 13:09:50 -05:00
|
|
|
justify-self: value;
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
2018-10-31 13:09:50 -05:00
|
|
|
|
|
|
|
where value is how you would like to horizontally align the item.
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-31 13:09:50 -05:00
|
|
|
|
|
|
|
Since this challenge requires you to (horizontally) center the item with the class `item2`, declare the following in your `.item2` CSS codeblock:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```css
|
2018-10-31 13:09:50 -05:00
|
|
|
justify-self: center;
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|