# How to have a flex child not fill entire height

> Learn how to stop a flex child from stretching to fill the full height of its row by applying align-self start, or the self-start class in Tailwind CSS.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2023-01-04 | Topics: [CSS](https://flaviocopes.com/tags/css/) | Canonical: https://flaviocopes.com/how-to-flex-child-not-fill-height/

I had a horizontal list of items, and if a line of text got to 2 lines, I had some additional space and its flex siblings were extending to full height.

![Before](https://flaviocopes.com/images/how-to-flex-child-not-fill-height/before.png)

This was the code

```jsx
<li class="flex">
  <code class="flex-none text-sm whitespace-normal mr-2 mt-0.5 bg-white text-black p-1 ">
    {new Date(post.date).toString().slice(4, 11)}
  </code>{' '}
  <code class="flex-none text-sm whitespace-normal mr-2 bg-black text-white border p-1 ">
    {post.tag}
  </code>
  <a href={'/' + post.url + '/'}>{post.title}</a>
</li>
```

To fix this, I added the `self-start` class to the `code` blocks which in Tailwind CSS applies the CSS `align-self: start;`

![After](https://flaviocopes.com/images/how-to-flex-child-not-fill-height/after.png)
