This is a list of IDs and classes provided by MediaWiki core or a bundled extension/skin.
This are commonly used by extensions and gadget developers alike.
When in doubt, consider checking with Codesearch and Global Search to empirically understand usage.
For a more extended collection of historically grown list of IDs and classes, visit Wikipedia's Catalogue of CSS classes.
Set for the entire HTML document. This indicates the browser has not successfully loaded our Grade A JavaScript layer (yet). For example, if the device is too old, or if the browser blocked JS, or if the user disabled it. This is automatically switched to .client-js. at run-time.
Set for the entire HTML document. Indicates the browser has or will successfully load our Grade A JavaScript layer. This is automatically switched from .client-nojs.
Set on text that is a comment (also known as edit summary or log reason), which appear in places such as page history, logs, and recent changes.
MediaWiki core
.diff
Set on the element containing the difference comparison between revisions and the action links for those revisions.
MediaWiki core
.mw-editsection
Set on the parent element containing the edit section link in section headings when viewing content. Added in MW 1.22 (change 49364).
.mw-first-heading
The page title. Added in MW 1.38 (for versions before, use .firstHeading).
All skins
.mediawiki
Set for the entire HTML document. This indicates the page was served through a MediaWiki skin. Commonly used to decide whether a style should not (or should only) apply to action=render and other external rendering contexts, e.g. in TemplateStyles or site styles.
MediaWiki core
.mw-body-content
Holds the content of the wiki page, or interface of the page action or special page.
Added on the same div as #mw-content-text.mw-parser-output, except when there is no such element (on special pages and file pages, or when not viewing the page (e.g. history) or if the page doesn't exist). More info: directionality support. Added in MW 1.18.
Warning:
Do not use this to get the content! (e.g. in JavaScript)
Holds everything between the page title and contentSub on the one hand, and ArticleFeedback and categories on the other hand. Present on each page view (includes history view, non-existing pages, print view, ...). Known issue: May contain unrelated elements (bug 35247). Added in MW 1.19 (r111647).
#p-logo, #p-personal, #p-views, etc
identifiers for "Portlets" the skin may arrange in its navigation or sidebar. Useful for e.g. addPortletLink()
MonoBook, Vector legacy (2010), Modern
.page-
Each page has a class on the body with the name of the page encoded after a page- prefix.
The skin used is declared on the body, with the skin selector. This selector is skin- postfixed by the name of the skin. Use skin-vector-2022 for new vector, skin-vector applies to both legacy and 2022.
All skins.
.skin--responsive
This class is added to the body when the responsive user preference option is on. Added in MW 1.37. See phab:T258290.
Used by MobileFrontend and Minerva to apply responsive sizing. As this can break some images and elements with absolute positioning (for overlays for instance), you can wrap images in an element with the class noresize to opt out from responsive sizing.
MobileFrontend and the mobile apps assume this is an infobox and will move it to after the lead of the article when they see fit. As well as applying dedicated styling for this often crucial element of Wikipedia articles.
Use on tables to load JavaScript to make the table sortable.
.notheme
iOS and Android app
Used to opt out content from the dark, black and sepia theming, which can be applied by the iOS and Android application which in turn makes use of the Page Content Service
Set on the parent element containing the edit section link in section headings when viewing content. Replaced in MW 1.22 with .mw-editsection in change 49364.
.warningbox, .errorbox, .successbox
(deprecated) Used by MediaWiki as the default container on some system messages (like the diff box).