一直都觉得这个首页的帖子上下边距太宽了,特别是description只有一行的时候,显得太空旷了,不喜欢这样

(浏览本篇之前,请先完成魔改准备工作

custom.css中添加如下代码,使用!important强制覆写:

/* 覆盖文章列表项的高度 */
#recent-posts .recent-post-item {
height: auto !important;
/* 允许高度根据内容自适应 */
padding-top: 40px !important;
/* 顶部内边距 40px */
padding-bottom: 40px !important;
/* 底部内边距 40px */
}

/* 针对小屏幕的高度覆盖 */
@media screen and (max-width: 768px) {
#recent-posts .recent-post-item {
height: auto !important;
padding-top: 10px !important;
padding-bottom: 10px !important;
}
}

/* 针对大屏幕的高度覆盖,但暂时无法测试 */
/* @media screen and (min-width: 2000px) {
#recent-posts .recent-post-item {
height: auto !important;
padding-top: 10px !important;
padding-bottom: 10px !important;
}
} */