# Flex box match element height

**URL:** <https://forum.freecodecamp.org/t/flex-box-match-element-height/649533>\
**Category:** I Built This\
**Created:** [November 9, 2023, 12:03am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533 "2023-11-09T00:03:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon86258595](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon86258595](https://forum.freecodecamp.org/u/anon86258595)\
**Post date:** [November 9, 2023, 12:03am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/1 "2023-11-09T00:03:52Z")

</div>

Hi Coders!  
I need feedback on this:

> **[vYbxaaq](https://codepen.io/Esther-The-Queen/pen/vYbxaaq)**
>
> ...

I’m trying to make the elements match the height of whatever row its on and nothing I do is working.  
Depending on the screen size I want the active calories and challenges div to grow in height.  
I’ve been trying to do this for ages already and nothing is doing.  
Thank you so much!

---

<div class="post-metadata">

**Author:** ![anon42932716](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anon42932716](https://forum.freecodecamp.org/u/anon42932716)\
**Post date:** [November 9, 2023, 12:14am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/2 "2023-11-09T00:14:54Z")

</div>

Hello @anon86258595 !

As you know, you are far more experienced with this.  
But, I did a search on Bing Chat and came up with this option using flex.

.flexbox {  
display: flex;  
flex-wrap: wrap;  
}

.column {  
flex: 1;  
}

.element {  
height: 100%;  
/\* or \*/  
align-items: stretch;  
}

I do not know if you have tried it.

Keep up your amazing progress and happy coding!

---

<div class="post-metadata">

**Author:** ![anon86258595](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon86258595](https://forum.freecodecamp.org/u/anon86258595)\
**Post date:** [November 9, 2023, 12:30am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/3 "2023-11-09T00:30:26Z")

</div>

Hello to you @anon42932716 😄!  
Thank you for your kind words, they mean a lot.  
I tried doing what you suggested and I can’t for the the life of me figure out why but nothing is changing.  
Thank your for trying though.  
@anon42932716, You are very experienced and kind!

---

<div class="post-metadata">

**Author:** ![anon42932716](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@anon42932716](https://forum.freecodecamp.org/u/anon42932716)\
**Post date:** [November 9, 2023, 12:36am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/4 "2023-11-09T00:36:17Z")

</div>

Thank you @anon86258595 for your kind words of support. They are valued by me.

I found something on a grid layout, too. But, that one changes according to the largest one in the row on the grid.

I wish I knew more to help. But, the real experienced people will be around to help you, I am sure. 🙂

Keep up your amazing progress in both your learning and your support in the forum.

Happy coding!

---

<div class="post-metadata">

**Author:** ![jim03](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jim03](https://forum.freecodecamp.org/u/jim03)\
**Post date:** [November 9, 2023, 1:27pm UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/5 "2023-11-09T13:27:47Z")

</div>

hiya Starstruck, this seems to work. Not sure if it works in all the conditions you want though. Give it a try.

```auto
div:not(.dashboard) {
  flex-grow: 1;
  flex-shrink: 1;
  height: auto;
}

```

---

<div class="post-metadata">

**Author:** ![anon86258595](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon86258595](https://forum.freecodecamp.org/u/anon86258595)\
**Post date:** [November 9, 2023, 1:37pm UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/6 "2023-11-09T13:37:16Z")

</div>

@jim03 your such an angel!  
It worked after adding the !important attribute and now it looks great.  
Thank you so much, It was bothering me the whole day and now I can finally stop stressing.  
I have no words, your Amazing 🤩!  
Its my first project that isn’t so bad so I’m hoping it gets picked on codepen 😆.  
Not that I know how those things work…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [May 10, 2024, 1:38am UTC](https://forum.freecodecamp.org/t/flex-box-match-element-height/649533/7 "2024-05-10T01:38:11Z")

</div>

Closed on May 10, 2024, 1:38am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
