打开/关闭菜单
239
885
35
2813
植物大战僵尸杂交版Wiki
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

MediaWiki:Common.css:修订间差异

MediaWiki界面页面
无编辑摘要
无编辑摘要
第171行: 第171行:
     /* 允许图片在这个阶段灵活调整高度 */
     /* 允许图片在这个阶段灵活调整高度 */
     height: auto;
     height: auto;
  }
}
/* === 响应式图片导航网格 === */
/* 核心容器:替代表格行为,用弹性布局自动换行 */
.responsive-image-grid {
  display: flex;
  flex-wrap: wrap;                    /* 关键:放不下就换行 */
  justify-content: center;            /* 图片组居中 */
  gap: 5px;                            /* 图片间距,类似 padding:5px */
  width: 100%;
  margin: 0 auto;
  text-align: center;
}
/* 容器内的每个图片项 */
.responsive-image-grid .image-item {
  flex: 0 1 auto;                      /* 可缩小,不强制放大 */
  max-width: 100%;
  display: block;
}
/* 强制让图片永远不超过单元格宽度 */
.responsive-image-grid .image-item img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* 针对 230px 的固定尺寸,在宽屏时不限制,但在需要时允许缩小 */
@media screen and (max-width: 480px) {
  .responsive-image-grid .image-item {
    /* 在小屏上,让图片项尺寸更灵活,主要靠 max-width 限制 */
    flex-basis: calc(50% - 10px);      /* 大约两列布局,可根据需要调整 */
    max-width: calc(50% - 10px);
   }
   }
}
}

2026年5月3日 (日) 11:58的版本

/* 电脑端样式 */
.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;
}
/* 为图片组创建一个弹性容器 */
.responsive-image-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; 
    gap: 10px;
}

/* 容器内的图片样式 */
.responsive-image-container img {
    max-width: 100%;
    height: auto;
    flex: 0 1 auto;
}
/* === 手机端多图防拥挤 + 自动换行 === */

/* 1. 定义通用容器:允许换行,并设置间距 */
.responsive-image-container {
  display: flex;
  flex-wrap: wrap; /* 允许换行 */
  gap: 8px; /* 图片间距 */
  justify-content: center; /* 居中更美观,可选 */
}

/* 2. 容器内所有图片的核心防拥挤样式 */
.responsive-image-container img {
  /* 这是关键:强制图片不能超出容器宽度,并自动缩小 */
  max-width: 100%;
  height: auto;
  
  /* 防止图片因为有内联宽高样式而不肯缩小 */
  width: auto; 
  
  /* 让图片灵活地占据空间,可缩小但不强制拉大 */
  flex: 0 1 auto; 
  
  display: block; /* 去除图片底部默认的几像素间隙 */
}

/* 3. 针对特别小的手机屏幕(宽度小于 480px),强制变成一列 */
@media screen and (max-width: 480px) {
  .responsive-image-container {
    /* 让所有图片纵向排列,彻底解决拥挤 */
    flex-direction: column; 
    align-items: center; /* 所有图片居中 */
  }
  
  .responsive-image-container img {
    /* 图片宽度撑满容器,避免侧边留白过多 */
    width: 100%;
    max-width: 100%;
    
    /* 允许图片在这个阶段灵活调整高度 */
    height: auto;
  }
}
/* === 响应式图片导航网格 === */

/* 核心容器:替代表格行为,用弹性布局自动换行 */
.responsive-image-grid {
  display: flex;
  flex-wrap: wrap;                     /* 关键:放不下就换行 */
  justify-content: center;             /* 图片组居中 */
  gap: 5px;                            /* 图片间距,类似 padding:5px */
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* 容器内的每个图片项 */
.responsive-image-grid .image-item {
  flex: 0 1 auto;                      /* 可缩小,不强制放大 */
  max-width: 100%;
  display: block;
}

/* 强制让图片永远不超过单元格宽度 */
.responsive-image-grid .image-item img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 针对 230px 的固定尺寸,在宽屏时不限制,但在需要时允许缩小 */
@media screen and (max-width: 480px) {
  .responsive-image-grid .image-item {
    /* 在小屏上,让图片项尺寸更灵活,主要靠 max-width 限制 */
    flex-basis: calc(50% - 10px);      /* 大约两列布局,可根据需要调整 */
    max-width: calc(50% - 10px);
  }
}