Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:User style
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Style depending on a parameter or 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. <code>class="abc{{{1|def}}}"</code>. 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. <code>class="abc{{{1}}}"</code> 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 HTML attribute name ==== An HTML attribute name can be made variable. [[HTML Tidy]] β an outdated HTML4 library that is [[:mw:Parsing/Replacing Tidy|slated for removal]] β has historically removed attributes with invalid names 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 [[Wikipedia:HiddenStructure]] and {{tiw|en|Infobox}}. ==== Variable style parameter value ==== Wikitext like <syntaxhighlight lang="html"><span style="display:{{{3|none}}}">Wed</span></syntaxhighlight> 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)