# Auto-Resize Height of child element to match parent Div

**URL:** <https://community.weweb.io/t/auto-resize-height-of-child-element-to-match-parent-div/2920>\
**Category:** Ask us anything\
**Created:** [June 2, 2023, 6:19pm UTC](https://community.weweb.io/t/auto-resize-height-of-child-element-to-match-parent-div/2920 "2023-06-02T18:19:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dorian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorian/32/13183_2.png) [@Dorian](https://community.weweb.io/u/Dorian)\
**Post date:** [June 2, 2023, 6:19pm UTC](https://community.weweb.io/t/auto-resize-height-of-child-element-to-match-parent-div/2920/1 "2023-06-02T18:19:39Z")

</div>

I can’t figure out how to have a child search bar element auto-resize itself to match the height of its parent Div element? Details in Loom. I also tried putting the child elements in a container inside the div, but couldn’t make that work either.

Thanks.

---

<div class="post-metadata">

**Author:** ![Dorian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorian/32/13183_2.png) [@Dorian](https://community.weweb.io/u/Dorian)\
**Post date:** [June 4, 2023, 1:03am UTC](https://community.weweb.io/t/auto-resize-height-of-child-element-to-match-parent-div/2920/2 "2023-06-04T01:03:03Z")

</div>

Based on what I read online, if the parent flex box is set to stretch, then the child elements should stretch to the height of the flex box. Weweb’s container does not seem to do work this way when set to stretch. Is this a bug?
