MediaWiki:Common.css
来自迷你世界维基
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* =================================================================== */
/* 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;
}
}
