2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Use the flex-basis Property to Set the Initial Size of an Item
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Use the flex-basis Property to Set the Initial Size of an Item
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
You can achieve the same effect as the previous two challenges with `flax-basis`.
|
|
|
|
After setting sthe appropiate values, you will see `#box-2` being bigger than `#box-1` before any shrinking or grow is applied.
|
|
|
|
|
|
|
|
```css
|
|
|
|
#box-1 {
|
|
|
|
background-color: dodgerblue;
|
|
|
|
height: 200px;
|
|
|
|
flex-basis: 10em;
|
|
|
|
}
|
|
|
|
|
|
|
|
#box-2 {
|
|
|
|
background-color: orangered;
|
|
|
|
height: 200px;
|
|
|
|
flex-basis: 20em;
|
|
|
|
}
|
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
</details>
|