MediaWiki:Common.css:修订间差异
来自迷你世界维基
无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* =================================================================== */ | /* =================================================================== */ | ||
/* Modern Infobox | /* Modern Div-Based Infobox (Final, Stable Version) */ | ||
/* This version uses divs instead of tables to avoid layout conflicts. */ | |||
/* =================================================================== */ | /* =================================================================== */ | ||
/* --- 1. Main Container | /* --- 1. Main Container --- */ | ||
. | .infobox-div { | ||
float: right; | float: right; | ||
width: 300px; | width: 300px; | ||
margin: 0.5em 0 1em 1.5em; | margin: 0.5em 0 1em 1.5em; | ||
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); | ||
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 | /* --- 2. Header --- */ | ||
. | .infobox-div-header { | ||
background-color: #495057; | background-color: #495057; | ||
color: #ffffff; | color: #ffffff; | ||
| 第36行: | 第27行: | ||
text-align: center; | text-align: center; | ||
} | } | ||
/* --- 3. Image Area --- */ | /* --- 3. Image Area --- */ | ||
. | .infobox-div-image { | ||
padding: 1em; | padding: 1em; | ||
text-align: center; | text-align: center; | ||
border-bottom: 1px solid #dee2e6; /* Separator line */ | |||
} | } | ||
.infobox-div-image img { | |||
. | |||
max-width: 100%; | max-width: 100%; | ||
height: auto; | height: auto; | ||
| 第52行: | 第40行: | ||
display: block; | display: block; | ||
} | } | ||
.infobox-div-caption { | |||
. | |||
margin-top: 0.75em; | margin-top: 0.75em; | ||
font-size: 0.95em; | font-size: 0.95em; | ||
| 第61行: | 第47行: | ||
} | } | ||
/* --- | /* --- 4. Data Row Layout (The Magic) --- */ | ||
.modern-infobox . | .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; | padding: 0.7em 1em; | ||
vertical-align: top; | vertical-align: top; | ||
} | } | ||
.infobox-div-label { | |||
. | |||
width: 35%; | width: 35%; | ||
font-weight: 600; | font-weight: 600; | ||
| 第76行: | 第70行: | ||
white-space: nowrap; | white-space: nowrap; | ||
} | } | ||
.infobox-div-data { | |||
. | |||
width: 65%; | width: 65%; | ||
color: #212529; | color: #212529; | ||
} | } | ||
/* --- | /* --- 6. Footer --- */ | ||
.infobox-div-footer { | |||
. | |||
background-color: #fff3cd; | background-color: #fff3cd; | ||
color: #856404; | color: #856404; | ||
| 第101行: | 第85行: | ||
} | } | ||
/* --- | /* --- 7. Responsive for Mobile --- */ | ||
@media (max-width: 720px) { | @media (max-width: 720px) { | ||
. | .infobox-div { | ||
float: none; | float: none; | ||
width: 100%; | width: 100%; | ||
margin: 1.5em 0; | margin: 1.5em 0; | ||
} | } | ||
} | } | ||
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;
}
}
