MediaWiki:Common.css:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 标签:手工回退 |
无编辑摘要 标签:已被回退 |
||
| 第69行: | 第69行: | ||
} | } | ||
/* | /* 关键修改:强制一行两个,图片按比例缩小 */ | ||
.gallery-card, | .gallery-card, | ||
.gallery-card-small { | .gallery-card-small { | ||
width: calc(50% - 5px); | width: calc(50% - 5px); | ||
max-width: none; | max-width: none; | ||
} | |||
/* 让图片本身填满卡片宽度,同时不超出 */ | |||
.gallery-card img, | |||
.gallery-card-small img { | |||
width: 100%; | |||
height: auto; | |||
object-fit: contain; | |||
} | } | ||
.flex-gallery { | .flex-gallery { | ||
gap: 10px; | gap: 10px; | ||
flex-wrap: nowrap; /* 关键:禁止换行 */ | |||
} | } | ||
} | } | ||
/* | /* 超小屏幕时改回一行一个 */ | ||
@media screen and (max-width: 480px) { | @media screen and (max-width: 480px) { | ||
.gallery-card, | .gallery-card, | ||
.gallery-card-small { | .gallery-card-small { | ||
width: 100%; | width: 100%; | ||
} | |||
.flex-gallery { | |||
flex-wrap: wrap; /* 恢复换行 */ | |||
} | } | ||
} | } | ||
2026年5月1日 (五) 07:42的版本
/* 电脑端样式 */
.responsive-two-columns .left-col {
width: 320px;
vertical-align: top;
}
.responsive-two-columns .right-col {
vertical-align: top;
padding-left: 20px;
}
/* 新增:响应式图片卡片样式 */
.gallery-card {
position: relative;
width: calc(50% - 5px); /* 一行两个,减去gap的一半 */
max-width: 500px;
text-align: center;
}
.gallery-card-small {
position: relative;
width: calc(50% - 5px);
max-width: 150px;
text-align: center;
}
.gallery-card img,
.gallery-card-small img {
width: 100%;
height: auto;
}
.image-overlay {
position: absolute;
bottom: 30px;
left: 10px;
text-align: left;
background: rgba(0,0,0,0.5);
color: white;
padding: 5px;
border-radius: 4px;
}
.flex-gallery {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
gap: 10px;
align-items: flex-start;
}
/* 手机端样式 */
@media screen and (max-width: 768px) {
.responsive-two-columns,
.responsive-two-columns tbody,
.responsive-two-columns tr,
.responsive-two-columns td {
display: block;
width: 100%;
}
.responsive-two-columns .right-col {
padding-left: 0;
margin-top: 20px;
}
.responsive-two-columns img {
max-width: 100%;
height: auto;
}
/* 关键修改:强制一行两个,图片按比例缩小 */
.gallery-card,
.gallery-card-small {
width: calc(50% - 5px);
max-width: none;
}
/* 让图片本身填满卡片宽度,同时不超出 */
.gallery-card img,
.gallery-card-small img {
width: 100%;
height: auto;
object-fit: contain;
}
.flex-gallery {
gap: 10px;
flex-wrap: nowrap; /* 关键:禁止换行 */
}
}
/* 超小屏幕时改回一行一个 */
@media screen and (max-width: 480px) {
.gallery-card,
.gallery-card-small {
width: 100%;
}
.flex-gallery {
flex-wrap: wrap; /* 恢复换行 */
}
}