Skip to content

Instantly share code, notes, and snippets.

@ajitid
Last active December 24, 2022 11:48
Show Gist options
  • Save ajitid/8eca4bdfe5ef2410e4b2c7e8e07d9d56 to your computer and use it in GitHub Desktop.
Save ajitid/8eca4bdfe5ef2410e4b2c7e8e07d9d56 to your computer and use it in GitHub Desktop.
Make child occupy full height

I usally assign root div a color and give it a color with min-height: 100vh (min-h-screen). But sometimes I need to use different style in a page. So if I make this child <div class="h-full">, it doesn't work. See this post.

I found this to be most reliable:

.parent {
  /* min-h-screen */
  min-height: 100vh;
}

.child {
  /* min-h-[inherit] */
  min-height: inherit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment