Make div fill remaining height of parent div in Tailwind CSS
P粉6966058332023-08-29 10:05:04
0
2
431
I want to place the King in the middle of the card, but how do I do that? I tried putting items-center into the second div which didn't work because the second div is just the height of the letter K
Your question is obviously unclear. Let me provide you with various possibilities to complete your task.
This type of layout is more predictable using a grid. Because flex will try to fill the available space, grid will not.
I gave two examples, one is completely centered regardless of the icon, and the other takes into account the position and size of the icon.
https://play.tailwindcss.com/6M290nY1NT