Manual:Interface/IDs and classes

From MediaWiki.org
Jump to: navigation, search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
English • ‎français • ‎日本語 • ‎polski

This page contains a list of common IDs and classes, especially when there is important information about what they're intended to be used for, or when there is a (possible) collision. For a more extended collection of historically grown list of IDs and classes visit Wikipedia's Catalogue of CSS classes.

Main selectors[edit]

Selector Skin(s) Description Availability
.client-nojs All Indicates the browser does not have JavaScript enabled (or the browser is not supported). If JavaScript is enabled, this is automatically removed at run time in favour of .client-js.
.client-js All Indicates the browser has JavaScript enabled and is supported by ResourceLoader. This is automatically added at run time, replacing .client-nojs on the <html> element.
.comment Comment (edit summary) in history, recent changes, watchlist, ... The parentheses are inside this span.
.diff Diff when comparing revisions.
.editsection Around the edit section link next to section headers.
.firstHeading MonoBook, Vector, Modern The page title
.mediawiki
.mw-body-content MonoBook, Vector Holds the page content, including categories, contentSub, ...
.mw-parser-output All See phab:T37247, phab:T164792, gerrit:352711 and (not merged yet) gerrit:352835.  ?
.mw-content-ltr Added on the same div as #mw-content-text, except 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. Warning: Do not use this to get the content! (e.g. in JavaScript) MW 1.18+ (r?)
.mw-content-rtl See .mw-content-ltr MW 1.18+ (r?)
#mw-content-text 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) MW 1.19+ (r111647)
#p-logo, #p-personal, #p-views, etc MonoBook, Vector, Modern identifiers for "Portlets" the skin may arrange in its navigation or sidebar. Useful for e.g. addPortletLink()
#pagehistory List of revisions when viewing action=history
.sitedir-ltr When the wiki content language direction is left-to-right. MW 1.18+ (r91518)
.sitedir-rtl When the wiki content language direction is right-to-left. MW 1.18+ (r91518)

Content[edit]

Selector Skin(s) Description Availability
.noprint MediaWiki core class available for action=print in most skins since at least MediaWiki 1.14.
.nomobile
.noexcerpt Used by Extension:TextExtracts to force it to be removed from consideration from text extracts.
.licensetpl A series of licensetpl*, fileinfotpl*, creator and other classes. See commons:Commons:Machine-readable data. See Extension:CommonsMetadata
.metadata See Help:Extension:Media Viewer#How can I disable Media Viewer for unrelated images? and Reading/Multimedia/Media Viewer/Template compatibility#Marking up article templates as ignored.
.noviewer See Help:Extension:Media Viewer#How can I disable Media Viewer for unrelated images?
.navigation-not-searchable See Help:CirrusSearch#Exclude content from the search index.
.searchaux See Help:CirrusSearch#Exclude content from the search index.
.tmbox, .ambox, #coordinates, .navbox, .vertical-navbox, .topicon MinervaNeue Undocumented, with MobileFrontend they assume the special meaning of being "secondary content". See Mobile Gateway/Mobile homepage formatting, discussion, resources/skins.minerva.content.styles/hacks.less.

Deprecated[edit]

Selector Skin(s) Description Availability
.ltr (deprecated) When the user language is left-to-right (LTR). Before that, when the content language was LTR. See also .rtl. MW 1.18+ (r?)
.rtl (deprecated) When the user language is right-to-left (RTL). Before that, when the content language was RTL. See also .ltr. MW 1.18+ (r?)
#bodyContent MonoBook, Vector (deprecated) Use .mw-body-content instead. Or better, use the more specific #mw-content-text if applicable.
#firstHeading MonoBook, Vector (deprecated) Use .firstHeading instead.