MediaWiki:Common.css
MediaWiki界面页面
更多操作
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* 电脑端样式 */
.responsive-two-columns .left-col {
width: 320px;
vertical-align: top;
}
.responsive-two-columns .right-col {
vertical-align: top;
padding-left: 20px;
}
/* 响应式图片画廊 - 一行两个 */
.flex-gallery {
display: grid;
grid-template-columns: repeat(2, 1fr); /* 固定一行两个,各占一半宽度 */
gap: 10px;
align-items: start;
}
/* 所有卡片通用样式 */
.gallery-card,
.gallery-card-small {
position: relative;
width: 100%; /* 填满grid单元格 */
text-align: center;
}
/* 图片自动缩放 */
.gallery-card img,
.gallery-card-small img {
width: 100%;
height: auto;
max-width: 100%;
}
/* 文字覆盖层 */
.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;
font-size: 14px;
}
/* 手机端样式 */
@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;
}
/* 手机端继续一行两个 */
.flex-gallery {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.image-overlay {
bottom: 15px;
left: 5px;
font-size: 12px;
padding: 3px 5px;
}
}
/* 超小屏幕(宽度小于500px)时改为一行一个,防止图片太小看不清 */
@media screen and (max-width: 500px) {
.flex-gallery {
grid-template-columns: 1fr;
gap: 10px;
}
}