MediaWiki:Common.css:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 |
无编辑摘要 标签:已被回退 |
||
| 第116行: | 第116行: | ||
.flexslider a img:hover { | .flexslider a img:hover { | ||
transform: none; | transform: none; | ||
} | |||
/* 让所有图片横向排列 */ | |||
img, | |||
.mw-file-element, | |||
a.image { | |||
display: inline-block; | |||
} | |||
/* 移除图片默认的块级行为 */ | |||
.mw-parser-output .image { | |||
display: inline-block; | |||
} | } | ||
2026年5月2日 (六) 09:43的版本
/* 电脑端样式 */
.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;
}
.flex-gallery {
gap: 10px;
}
}
/* 超小屏幕(宽度小于480px)时改为一行一个 */
@media screen and (max-width: 480px) {
.gallery-card,
.gallery-card-small {
width: 100%;
}
}
/* 只有带链接且不在card/轮播内的图片才有悬停放大效果 */
a img {
transition: transform 0.3s ease;
}
a img:hover {
transform: scale(1.08);
z-index: 10;
position: relative;
}
/* 精确排除card模板和轮播图 - 不使用慢速选择器 */
.card a img,
.swiper a img,
.carousel a img,
.slider a img,
.owl-carousel a img,
.flexslider a img {
transition: none;
}
.card a img:hover,
.swiper a img:hover,
.carousel a img:hover,
.slider a img:hover,
.owl-carousel a img:hover,
.flexslider a img:hover {
transform: none;
}
/* 让所有图片横向排列 */
img,
.mw-file-element,
a.image {
display: inline-block;
}
/* 移除图片默认的块级行为 */
.mw-parser-output .image {
display: inline-block;
}