Manual:Interface/Stylesheets/de

MediaWiki:Common.css ist ein Cascading Style Sheet, das nach dem Stylesheet des aktiven Skin geladen wird. Dieses Stylesheet wird mit allen geladen und ein ähnliches, für das Skin spezifisches Stylesheet mit dem Namen "" wird daran angehängt (siehe unten). Obwohl auf Special:AllMessages nur Monobook.css aufgeführt ist, funktionieren die anderen Skin-spezifischen Stylesheets trotzdem.

Wenn auf true gesetzt ist, können Benutzer die Benutzeroberfläche nur für sich selbst anpassen, indem sie Benutzer-Unterseiten mit Titeln in Kleinbuchstaben erstellen (siehe unten).

Globale Stylesheets werden nicht auf speziellen eingeschränkten Seiten wie Anmeldung oder Einstellungen geladen, es sei denn, Sie aktivieren.

They also won't load if is used.



Liste der Stylesheets


Globale Stylesheets
These are stylesheets that affect all users of the wiki, depending on their setup — what skin they use, their user group, etc.


 * MediaWiki:Common.css - (alle Skins und alle Benutzer, außer dem MobileFrontend)
 * MediaWiki:skinname.css - (Pro Skin ist skinname der Wert dieser Variable in der PHP-Datei Ihres Skins, zum Beispiel MediaWiki:Vector.css, MediaWiki:Monobook.css)
 * - (pro Benutzergruppe, zum Beispiel MediaWiki:Group-sysop.css)
 * MediaWiki:Noscript.css - (für Benutzer ohne JavaScript; kann durch einen -Selektor ersetzt werden)
 * MediaWiki:Print.css - (für "druckbare Versionen" von Seiten)
 * MediaWiki:Mobile.css - (für mobile Designs, verwendet mit )
 * MediaWiki:Filepage.css - speziell darauf ausgerichtet, dass Commons-Dateiseiten (fremde Repositories) auf "lokalen" Dateiseiten funktionieren.

Personal stylesheets
These are stylesheets that only yourself and users with the right, usually interface admins, can edit.


 * User:Example/common.css - (alle Skins - eingeführt in MW v1.17)
 * User:Example/skinname.css - (pro Skin, zum Beispiel User:Example/vector.css und User:Example/monobook.css)
 * User:Example/global.css - (pro Wiki-Familie, wenn für diese Familie verwendet wird)

CSS selectors
In the Monobook skin, the CSS selectors relevant for the style of the page body include the following. As far as possible, examples are given, which show the result for the current style settings:


 * : link – unvisited link – example: help:index ; default: help:index
 * : visited – visited link
 * : link#contentTop
 * : link.external – http://example ; default:  http://example
 * : link.extiw – interwiki link in page body – example ; default: en:example
 * : link.image – link from full image to image description page
 * : link.internal – link to file itself (Media:), and links from thumbnail and magnifying glass icon to image description page (note that color and font size specified for a.internal are only applicable in the first case) - [[Media:example.png]]
 * : link.new – doesnotexist ; default: doesnotexist
 * .allpagesredirect – abc – redirects in Special:Allpages and Special:Prefixindex
 * body.ns-0, ..., body.ns-15 (namespaces)
 * div#bodyContent
 * div#column-content
 * div#editsection
 * div#globalWrapper
 * div#tocindent
 * div.tocline
 * h1.firstHeading
 * h2
 * h3
 * small – example
 * table.toc
 * : link and : visited – It's a common mistake to use "a" instead of ": link" or ": visited" to style links (unvisited and visited, respectively). Whereas later pseudoclasses apply only to links, "a" applies to both links and named anchors (e.g. ).


 * #p-lang a – for interlanguage links

One may also have the style depend on the value of an attribute, e.g. with the selectors:



to color-code or highlight particular users (including oneself) and/or links to particular pages (like the bolding of watched pages on Recent Changes).


 * See also Help:Watching pages

The watchlist and Recent Changes use two classes:
 * .autocomment example
 * .new (see below)

The page history has classes autocomment and:
 * .user
 * .minor

Thus the font specified for user applies in the page history, but not in the watchlist or Recent Changes.

Edit page
example1 example2
 * Edit box: textarea#wpTextbox1
 * Edit summary box: input#wpSummary

Non-display
One extreme "style" for a text or image is not displaying it, with .classname {display: none}
 * 1) id {display: none}

Non-displayed links do not work (as opposed to links in a very small font).

One application is the use of a.

It cannot be used to remove text in expressions for template names, parameter names, parameter values, page names in link targets, etc.

These can now be done with ParserFunctions

While "display: none" produces nothing, "visibility: hidden" produces blank spaces replacing the content; its opposite is "visibility: visible".

Example:
 * gives p q r

Style depending on a parameter or variable
A class or id can depend on the result produced by a template or on a template parameter, e.g. class="abc ". For one or more of the possible class names the style of that class can be defined. If the class is undefined it is ignored, so the standard style is used. Classes for general use should be defined in MediaWiki:Common.css.

In the simplest case we have e.g. class="abc " and define class abcdef. If the parameter value is "def" it applies. Another example is.

A HTML attribute name can be made variable. Attributes with invalid names are removed at the server side, so the result does not depend on a browser capability to ignore invalid attribute names, and the amount of data sent is reduced. For a variable with possible value "class", see.

One more option is to use wikitext like which displays "Wed" if parameter 3 is defined, but not "none", and displays nothing if parameter 3 is undefined or "none". If the value of parameter 3 is a display style other than "none", that style is applied.



Siehe auch

 * Manual:Gallery of user styles
 * Hilfe:Cascading Stylesheets
 * Hilfe:Cascading Stylesheets