Skip to content

some height classes like .h-1/2 etc are not working...? #3022

Answered by simonswiss
Ochirpurev20 asked this question in Help
Discussion options

You must be logged in to vote

Hey!

These will only work relatively to the parent element from where the class is applied, since they're percentage values.

I have made an example where your code is wrapped in a h-screen container (full height of the viewport). You can see the two sections taking 2/3 and 1/2 of the height in that case:

https://play.tailwindcss.com/HRNm5g8JF7

Same deal if the parent is h-80 (20rem) in height - the two sections will use 2/3 and 1/2 of that height:

https://play.tailwindcss.com/pYMkx7taUl

Hope it helps!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by simonswiss
Comment options

You must be logged in to vote
1 reply
@simonswiss
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants