Help:Cascading Style Sheets: Difference between revisions

Content deleted Content added
m {{tag}}
Reverting edit(s) by 102.45.18.254 (talk) to rev. 1297657178 by Annh07: Unexplained content removal (UV 0.1.6)
 
(24 intermediate revisions by 16 users not shown)
Line 89:
Some wikitext elements allow you to insert CSS styling directly into them. An example is the table syntax:
{{-}}
<syntaxhighlight lang="wikitext">
<pre>
{| style="your style here"
|-
|your table stuff
|}
</syntaxhighlight>
</pre>
{{Further2|[[Help:Tables]]}}
 
Line 113:
One extreme "style" for a text is not displaying it, with
 
<syntaxhighlight lang="css">
.''classname'' {display: none}
#.''idclassname'' {display: none}
.#''classnameid'' {display: none}
</syntaxhighlight>
 
etc.
Line 126 ⟶ 128:
=== 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">
<div class="someclass noprint">This will not appear in the print version.</div>
Line 156 ⟶ 158:
=== 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="moinwikitext" inline>class="abc{{{1|def}}}"</syntaxhighlight>". 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="moinwikitext" inline>class="abc{{{1}}}"</syntaxhighlight>" 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.