CSS网格填充相同高度的容器,底部的按钮
我有以下示例,用尾风CSS编写:
https://play.tail.tail.tail.tailwindcss.com/f9iok/f9iok/f9iok1eok1e0om i i i i i i
i>想要将我的控制按钮放在底部,如果网格容器具有不同的内容尺寸的蓝色“标签”框,因此网格的高度增加了一些容器。但是,当我使用网格时,所有盒子都得到了这个高度。没关系。但是我的控制按钮应该始终位于容器的底部,以便在第二个容器的底部不应远离“启用”和“删除”。
如何实现这一目标?
I have following sample, written in tailwind css:
https://play.tailwindcss.com/f9iOK1e0oM
I want to have my control buttons on the bottom if the grid containers, however, they have different content sizes for the blue "tag" boxes, so the grid gets increased in height by some containers. however, as I am working with grid, all boxes are getting this height then. this is ok. But my control buttons should be always on the bottom of the containers, so that "Enabled" and "Delete" should not be so far away from bottom for the second container.
How to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将
flex-col
添加到li
元素。 <代码>将添加到第一个儿童div和grow-0 max-h-max
到第二个儿童div。https://play.tailwindcss.com/iltmm5glklku
我只在第二张卡中做到了这一点,但是您应该为所有卡做。因此,当内容更改时,按钮行将始终粘在底部并保持所有卡中的相同高度。
希望这会有所帮助。
You need to add
flex flex-col
to theli
element. Andgrow
to the first child div andgrow-0 max-h-max
to the second child div.https://play.tailwindcss.com/ilTMM5glku
I have done this only for the second card, but you should do it for all cards. So that when the content changes, the button row will always stick to the bottom and keep the same height in all cards.
Hope this helps.