Jump to content

Help:Cascading Style Sheets: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
No edit summary
m Reverted changes by 2001:1260:21C:80D3:79C6:E709:991:580E (talk) to last version by Pppery
Tag: Rollback
 
(38 intermediate revisions by 22 users not shown)
Line 1: Line 1:
{{MovedToMediaWiki|Manual:Interface/Stylesheets}}
{{Hor variable==
===Variable class or id==

A class or id can depend on the result produced by a template or on a template parameter, e.g. class="abc<nowiki>{{{1|def}}}</nowiki>". 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.

In the simplest case we have e.g. class="abc<nowiki>{{{1}}}</nowiki>" and define class abcdef. If the parameter value is "def" it applies.

If a page for general use only makes sense when styles are defined for certain classes, then these have to be specified in the page MediaWiki:Common.css, which applies for all users and all skins, as far as not overridden.

===Variable style parameter value===

Wikitext like
<nowiki><span style="display:{{{3|none}}}">Wed</span></nowiki>
displays "Wed" if parameter 3 is defined, but its value is 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.

==See also==
*[[s]]

Latest revision as of 10:54, 12 December 2023