Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Flex child not stretching to full height of parent

Hi guys!

One quick question I'm not able to find the solution to myself. I have a flex parent with flex-direction: column now the child is not stretching the full height of the parent. When I remove the flex-direction: column on the parent, it does stretch. Here's the beta page where this can be seen: http://emcdeadviseur.wpengine.com/diensten/de-iso-adviseur/

You see three tiles, one with a unordered list and two without. The heading of the tile is a link, now what I want is when the tile has no list, the heading link to stretch to the full height of the tile. the .dienst__content is the div in question. align-content or align-items :stretch does not work on .dienst__content either.

how can I achieve this?

Thanks!

1 Answer

Look at that you flex parent don't had a justify-content specificied. Or try justify-content: stretch;

parent-element {
    display: flex;
    flex-direction: column;
}

child-element {
     justify-content: stretch;
}

Tell me if works.

Hi @alejandronarvaja,

Thanks for your answer! This does not work though, when I apply justify-content: stretch; on the heading h3 element, it still does not vertically stretch...