最小化 CSS 中显示网格中的表格单元格高度

问题描述

我正在开发一个使用网格的网站。只是为了让它看起来更专业和美观。我想最小化每个表格大小,其中单元格底部没有开放填充。我试图创造一个我真正想要的形象。红色部分代表内容,打开的框就是表格单元格。 Here is where I am currently at (this is what I don't want). 我想要的是底部没有开放的填充,它下面的每个元素都向上移动。 This is more of what I want.

这是我的代码

.grid {
    display: grid;
    grid-gap: 24px;
    color: #291F1E;
    background-color: none;
    height: auto;
    width: calc(100% - 48px);
    max-height: auto;
    max-width: 1440px;
    position: relative;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
}

@media screen and (orientation: landscape) {
    .grid { grid-template-columns: repeat(2,1fr); }
}

@media screen and (orientation: portrait) {
    .grid { grid-template-columns: repeat(1,1fr); }
}

.card {
    height: auto;
    width: auto;
    background-color: #F7F5FA;
    color: #291F1E;
    position: relative;
    padding: 24px;
    overflow: hidden;
    transition: 0.5s transform;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)