Help:Cascading Style Sheets: Difference between revisions

Content deleted Content added
m Reverted test edits.
m syntaxhighlight
Line 122:
It cannot be used to remove text in expressions for template names, parameter names, parameter values, page names in links, etc.
 
To view hidden text, download the Web Developer Toolbar for Firefox [https://addons.mozilla.org/en-US/firefox/addon/60 here], then choose Misc. ->→ show hidden elements in that toolbar. It will make all hidden elements appear.
 
=== Non-print ===
 
One can exclude content from being printed (if the browser supports CSS) by declaring the content to be of the "noprint" class:
<syntaxhighlight lang="html">
<pre>
<div class="someclass noprint">This will not appear in the print version.</div>
</syntaxhighlight>
</pre>
 
== Major style blocks ==
Line 156:
=== Variable class or id ===
 
A class or id can depend on the result produced by a template or on a template parameter, e.g. <syntaxhighlight lang="moin" inline>class="abc<nowiki>{{{1|def}}}</nowikisyntaxhighlight>". 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. <syntaxhighlight lang="moin" inline>class="abc<nowiki>{{{1}}}</nowikisyntaxhighlight>" 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.
Line 165:
 
Wikitext that reads
<nowikisyntaxhighlight lang="html"><span style="display:{{{3|none}}}">Wed</span></nowikisyntaxhighlight>
will display "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.