MediaWiki:Common.css: Difference between revisions
Appearance
Fix hero image sizing, keep external image constraints |
Fix hero image CSS specificity |
||
| Line 1: | Line 1: | ||
/* Constrain external images in article content to a reasonable size */ | /* Constrain external images in article content to a reasonable size */ | ||
.mw-parser-output img:not(.mw-file-element | .mw-parser-output img:not(.mw-file-element) { | ||
max-width: 200px; | max-width: 200px; | ||
max-height: 250px; | max-height: 250px; | ||
| Line 7: | Line 7: | ||
} | } | ||
/* Hero banner image on Main Page */ | /* Hero banner image on Main Page - override the constraint above */ | ||
.mw-parser-output .cs-hero-banner img { | |||
max-width: 100% !important; | |||
max-height: 350px !important; | |||
width: 100% !important; | |||
height: auto !important; | |||
object-fit: cover; | |||
border-radius: 6px; | |||
display: block; | |||
} | |||
.cs-hero-banner { | .cs-hero-banner { | ||
text-align: center; | text-align: center; | ||
margin-bottom: 1em; | margin-bottom: 1em; | ||
overflow: hidden; | overflow: hidden; | ||
border-radius: 6px; | border-radius: 6px; | ||
} | } | ||
Revision as of 10:04, 14 April 2026
/* Constrain external images in article content to a reasonable size */
.mw-parser-output img:not(.mw-file-element) {
max-width: 200px;
max-height: 250px;
width: auto;
height: auto;
}
/* Hero banner image on Main Page - override the constraint above */
.mw-parser-output .cs-hero-banner img {
max-width: 100% !important;
max-height: 350px !important;
width: 100% !important;
height: auto !important;
object-fit: cover;
border-radius: 6px;
display: block;
}
.cs-hero-banner {
text-align: center;
margin-bottom: 1em;
overflow: hidden;
border-radius: 6px;
}