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

MediaWiki:Common.css:修订间差异

MediaWiki界面页面
无编辑摘要
无编辑摘要
第117行: 第117行:
     transform: none;
     transform: none;
}
}
/* === 固定一行5个,手机自动换行 === */
/* === 表格响应式:电脑一行5个,手机自动换行 === */


/* 电脑端:强制一行5个,表格宽度自适应 */
/* 电脑端:保持原样,固定5列 */
@media screen and (min-width: 769px) {
@media screen and (min-width: 769px) {
   .responsive-fixed-grid,
   .responsive-fixed-grid {
  table.responsive-fixed-grid {
     width: auto;
     width: auto;           /* 表格宽度由内容决定,不强制撑满 */
     margin: 0 auto;
     margin: 0 auto;
     table-layout: fixed;   /* 固定列宽算法,确保每列一致 */
     table-layout: fixed;
   }
   }
    
    
   table.responsive-fixed-grid td {
   .responsive-fixed-grid td {
     width: 20%;           /* 100% 除以5列 = 每列20% */
     width: 20%;
     padding: 5px;
     padding: 5px;
     text-align: center;
     text-align: center;
    box-sizing: border-box;
   }
   }
    
    
   /* 确保里面的图片能适当缩放以适应列宽 */
   .responsive-fixed-grid td img {
  table.responsive-fixed-grid td img {
     max-width: 100%;
     max-width: 100%;
     height: auto;
     height: auto;
第141行: 第140行:
}
}


/* 手机端(小于768px):打破表格布局,变成自动换行的弹性盒子 */
/* 手机端:表格变成弹性布局,自动换行 */
@media screen and (max-width: 768px) {
@media screen and (max-width: 768px) {
   table.responsive-fixed-grid {
   .responsive-fixed-grid {
    display: block ;
    width: 100% ;
  }
 
  /* 把原有的表格行 tr 隐藏掉,我们重新排列 */
  table.responsive-fixed-grid tr {
    display: contents ;    /* 让单元格直接变成弹性容器的子元素 */
  }
 
  /* 让表格体也可以用弹性布局 */
  table.responsive-fixed-grid tbody {
     display: flex;
     display: flex;
     flex-wrap: wrap;
     flex-wrap: wrap;
第162行: 第150行:
   }
   }
    
    
   table.responsive-fixed-grid td {
   .responsive-fixed-grid tbody,
  .responsive-fixed-grid tr {
    display: contents;
  }
 
  .responsive-fixed-grid td {
     display: block;
     display: block;
     flex: 0 1 auto;                 /* 允许缩小 */
     flex: 0 1 auto;
     max-width: calc(33.33% - 8px); /* 手机上一行3个,留出间距 */
     max-width: calc(33.33% - 6px);
     width: auto;
     width: auto;
     padding: 3px;
     padding: 3px;
     text-align: center;
     text-align: center;
    box-sizing: border-box;
   }
   }
    
    
   table.responsive-fixed-grid td img {
   .responsive-fixed-grid td img {
     max-width: 100%;
     max-width: 100%;
     height: auto;
     height: auto;
第178行: 第172行:
}
}


/* 更小屏幕(480px以下),改为一行2个 */
/* 更小屏幕:一行2个 */
@media screen and (max-width: 480px) {
@media screen and (max-width: 480px) {
   table.responsive-fixed-grid td {
   .responsive-fixed-grid td {
     max-width: calc(50% - 8px);     /* 一行2个 */
     max-width: calc(50% - 5px);
   }
   }
}
}

2026年5月3日 (日) 12:04的版本

/* 电脑端样式 */
.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;
}
/* === 表格响应式:电脑一行5个,手机自动换行 === */

/* 电脑端:保持原样,固定5列 */
@media screen and (min-width: 769px) {
  .responsive-fixed-grid {
    width: auto;
    margin: 0 auto;
    table-layout: fixed;
  }
  
  .responsive-fixed-grid td {
    width: 20%;
    padding: 5px;
    text-align: center;
    box-sizing: border-box;
  }
  
  .responsive-fixed-grid td img {
    max-width: 100%;
    height: auto;
  }
}

/* 手机端:表格变成弹性布局,自动换行 */
@media screen and (max-width: 768px) {
  .responsive-fixed-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 100%;
  }
  
  .responsive-fixed-grid tbody,
  .responsive-fixed-grid tr {
    display: contents;
  }
  
  .responsive-fixed-grid td {
    display: block;
    flex: 0 1 auto;
    max-width: calc(33.33% - 6px);
    width: auto;
    padding: 3px;
    text-align: center;
    box-sizing: border-box;
  }
  
  .responsive-fixed-grid td img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}

/* 更小屏幕:一行2个 */
@media screen and (max-width: 480px) {
  .responsive-fixed-grid td {
    max-width: calc(50% - 5px);
  }
}