MediaWiki:Common.css:修订间差异

来自迷你世界维基
无编辑摘要
无编辑摘要
第1行: 第1行:
/* =================================================================== */
/* =================================================================== */
/* Modern Infobox Styles (Final Version with Root Cause Fix)           */
/* Modern Div-Based Infobox (Final, Stable Version)                   */
/* This version uses divs instead of tables to avoid layout conflicts. */
/* =================================================================== */
/* =================================================================== */


/* --- 1. Main Container: The Card Itself --- */
/* --- 1. Main Container --- */
.modern-infobox {
.infobox-div {
  /* Layout & Sizing */
  display: table !important; /* Prevents some theme styles from treating it as a block */
   float: right;
   float: right;
   width: 300px;
   width: 300px;
   margin: 0.5em 0 1em 1.5em;
   margin: 0.5em 0 1em 1.5em;
  /* === CRITICAL FIX for modern layout stretching === */
  /* This rule tells the box to IGNORE stretch commands from a parent container (like on mobile) */
  align-self: start !important;
 
  /* Visual Styles */
   background-color: #f8f9fa;
   background-color: #f8f9fa;
   border: 1px solid #dee2e6;
   border: 1px solid #dee2e6;
   border-radius: 8px;
   border-radius: 8px;
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border-collapse: separate;
  border-spacing: 0;
   font-size: 90%;
   font-size: 90%;
   line-height: 1.6;
   line-height: 1.6;
   overflow: hidden;
   overflow: hidden; /* Keeps content within rounded corners */
}
}


/* --- 2. Header: The Title Bar --- */
/* --- 2. Header --- */
.modern-infobox .modern-infobox-header {
.infobox-div-header {
   background-color: #495057;
   background-color: #495057;
   color: #ffffff;
   color: #ffffff;
第36行: 第27行:
   text-align: center;
   text-align: center;
}
}
/* ... (The rest of the CSS is the same, I'll include it for completeness) ... */


/* --- 3. Image Area --- */
/* --- 3. Image Area --- */
.modern-infobox .modern-infobox-image {
.infobox-div-image {
   padding: 1em;
   padding: 1em;
   text-align: center;
   text-align: center;
   background-color: #ffffff;
   border-bottom: 1px solid #dee2e6; /* Separator line */
}
}
 
.infobox-div-image img {
.modern-infobox .modern-infobox-image img {
   max-width: 100%;
   max-width: 100%;
   height: auto;
   height: auto;
第52行: 第40行:
   display: block;
   display: block;
}
}
 
.infobox-div-caption {
/* --- 4. Image Caption --- */
.modern-infobox .modern-infobox-caption {
   margin-top: 0.75em;
   margin-top: 0.75em;
   font-size: 0.95em;
   font-size: 0.95em;
第61行: 第47行:
}
}


/* --- 5. Data Rows: Labels and Information --- */
/* --- 4. Data Row Layout (The Magic) --- */
.modern-infobox .modern-infobox-label,
.infobox-div-row {
.modern-infobox .modern-infobox-data {
  display: flex; /* Uses modern flexbox for layout */
  border-top: 1px solid #dee2e6;
}
/* This selector ensures the very first row doesn't have a top border */
.infobox-div-image + .infobox-div-row,
.infobox-div-header + .infobox-div-row {
  border-top: none;
}
 
/* --- 5. Label and Data Cells --- */
.infobox-div-label,
.infobox-div-data {
   padding: 0.7em 1em;
   padding: 0.7em 1em;
  border-top: 1px solid #dee2e6;
   vertical-align: top;
   vertical-align: top;
}
}
 
.infobox-div-label {
/* --- 6. Label Column --- */
.modern-infobox .modern-infobox-label {
   width: 35%;
   width: 35%;
   font-weight: 600;
   font-weight: 600;
第76行: 第70行:
   white-space: nowrap;
   white-space: nowrap;
}
}
 
.infobox-div-data {
/* --- 7. Data Column --- */
.modern-infobox .modern-infobox-data {
   width: 65%;
   width: 65%;
   color: #212529;
   color: #212529;
}
}


/* --- 8. Links within the infobox --- */
/* --- 6. Footer --- */
.modern-infobox .modern-infobox-data a {
.infobox-div-footer {
  color: #0056b3;
}
.modern-infobox .modern-infobox-data a:visited {
  color: #4a1a7a;
}
 
/* --- 9. Footer/Warning Message --- */
.modern-infobox .modern-infobox-footer {
   background-color: #fff3cd;
   background-color: #fff3cd;
   color: #856404;
   color: #856404;
第101行: 第85行:
}
}


/* --- 10. Responsive Design for Mobile --- */
/* --- 7. Responsive for Mobile --- */
@media (max-width: 720px) {
@media (max-width: 720px) {
   .modern-infobox {
   .infobox-div {
     float: none;
     float: none;
     width: 100%;
     width: 100%;
     margin: 1.5em 0;
     margin: 1.5em 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
   }
   }
}
}

2025年10月2日 (四) 13:49的版本

/* =================================================================== */
/* Modern Div-Based Infobox (Final, Stable Version)                    */
/* This version uses divs instead of tables to avoid layout conflicts. */
/* =================================================================== */

/* --- 1. Main Container --- */
.infobox-div {
  float: right;
  width: 300px;
  margin: 0.5em 0 1em 1.5em;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  font-size: 90%;
  line-height: 1.6;
  overflow: hidden; /* Keeps content within rounded corners */
}

/* --- 2. Header --- */
.infobox-div-header {
  background-color: #495057;
  color: #ffffff;
  font-size: 1.25em;
  font-weight: 600;
  padding: 0.8em 1em;
  text-align: center;
}

/* --- 3. Image Area --- */
.infobox-div-image {
  padding: 1em;
  text-align: center;
  border-bottom: 1px solid #dee2e6; /* Separator line */
}
.infobox-div-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}
.infobox-div-caption {
  margin-top: 0.75em;
  font-size: 0.95em;
  color: #6c757d;
  line-height: 1.4;
}

/* --- 4. Data Row Layout (The Magic) --- */
.infobox-div-row {
  display: flex; /* Uses modern flexbox for layout */
  border-top: 1px solid #dee2e6;
}
/* This selector ensures the very first row doesn't have a top border */
.infobox-div-image + .infobox-div-row,
.infobox-div-header + .infobox-div-row {
  border-top: none;
}

/* --- 5. Label and Data Cells --- */
.infobox-div-label,
.infobox-div-data {
  padding: 0.7em 1em;
  vertical-align: top;
}
.infobox-div-label {
  width: 35%;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}
.infobox-div-data {
  width: 65%;
  color: #212529;
}

/* --- 6. Footer --- */
.infobox-div-footer {
  background-color: #fff3cd;
  color: #856404;
  text-align: center;
  padding: 0.7em;
  font-size: 0.9em;
  border-top: 1px solid #dee2e6;
}

/* --- 7. Responsive for Mobile --- */
@media (max-width: 720px) {
  .infobox-div {
    float: none;
    width: 100%;
    margin: 1.5em 0;
  }
}