Make div fill remaining height of parent div in Tailwind CSS-PHP Chinese Network Q&A
Make div fill remaining height of parent div in Tailwind CSS
P粉696605833
P粉696605833 2023-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

k
P粉696605833
P粉696605833

reply all (2)
P粉517090748

Your question is obviously unclear. Let me provide you with various possibilities to complete your task.

k

k

k


k

k
    P粉384679266

    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

     
    k
    k
    k
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!