Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Infobox/doc
(section)
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
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!
== Presentation parameters == === Italic titles === Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter. * Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox. Note that passing a blank value for {{para|italic title}} will make the article title italic. * Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|<nowiki>{{{italic title|no}}}</nowiki>}} * Do not make any titles italic by not passing the parameter at all. === CSS styling === Note: The following parameters are deprecated in favor of [[#TemplateStyles|TemplateStyles]]. {| class="wikitable" |- ! scope="col" | Parameter ! scope="col" | Explanation ! scope="col" | TemplateStyles replacement class |- | {{para|bodystyle}} | Applies to the infobox table as a whole. | {{nowrap|Class assigned to the template in {{para|bodyclass}}}} |- | {{para|titlestyle}} | Applies only to the title caption. Adding a background color is usually inadvisable since the text is rendered "outside" the infobox. | {{code|lang=css|.infobox-title}} |- | {{para|abovestyle}} | Applies only to the "above" cell at the top. The default style has font-size:125%; since this cell is usually used for a title, if you want to use the above cell for regular-sized text include "font-size:100%;" in the abovestyle. | {{code|lang=css|.infobox-above}} |- | {{para|imagestyle}} | Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future. | {{code|lang=css|.infobox-image}} |- | {{para|caption}} | Applies to the text of the image caption. | {{code|lang=css|.infobox-caption}} |- | {{para|rowstyle<sub>n</sub>}} | This parameter is inserted into the <code>style</code> attribute for the specified row. | Class assigned to the row in {{para|rowclass<sub>n</sub>}} |- | {{para|rowcellstyle<sub>n</sub>}} | This parameter is inserted into the <code>style</code> attribute for all cells in a specified row. | Class assigned to the cells in {{para|class<sub>n</sub>}} |- | {{para|headerstyle}} | Applies to all header cells. | {{code|lang=css|.infobox-header}} |- | {{nowrap|{{para|subheaderstyle}}}} | Applies to all subheader cells. | {{code|lang=css|.infobox-subheader}} |- | {{para|labelstyle}} | Applies to all label cells. | {{code|lang=css|.infobox-label}} |- | {{para|datastyle}} | Applies to all data cells. | {{code|lang=css|.infobox-data}} or {{code|lang=css|.infobox-full-data}} |- | {{para|belowstyle}} | Applies only to the below cell. | {{code|lang=css|.infobox-below}} |} === HTML classes and microformats === {{div col}} ; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole. ; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption. <!-- currently not implemented in Lua module ; aboverowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''above''' cell is on. --> ; aboveclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''above''' cell. ; subheaderrowclass(n) : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''subheader''' is on. ; subheaderclass(n) : This parameter is inserted into the <code>class</code> attribute for the infobox's '''subheader'''. ; imagerowclass(n) : These parameters are inserted into the <code>class</code> attribute for the complete table row their respective '''image''' is on. ; imageclass : This parameter is inserted into the <code>class</code> attribute for the '''image'''. ; rowclass(n) : This parameter is inserted into the <code>class</code> attribute for the specified row including the '''label''' and '''data''' cells. ; class(n) : This parameter is inserted into the <code>class</code> attribute for the '''data''' cell of the specified row. If there's no '''data''' cell it has no effect. <!-- currently not implemented in Lua module ; belowrowclass : This parameter is inserted into the <code>class</code> attribute for the complete table row the '''below''' cell is on. --> ; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell. {{div col end}} This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others being used for microformats. To flag an infobox as containing [[hCard]] information, for example, add the following parameter: <syntaxhighlight lang="wikitext" style="overflow: auto;"> | bodyclass = vcard </syntaxhighlight> {{clear}} And for each row containing a data cell that's part of the vcard, add a corresponding class parameter: <syntaxhighlight lang="wikitext" style="overflow: auto;"> | class1 = fn | class2 = org | class3 = tel </syntaxhighlight> {{clear}} ...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox. See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general. === TemplateStyles === {{further|Wikipedia:TemplateStyles}} The TemplateStyles parameters {{para|templatestyles}}, {{para|child templatestyles}}, and {{para|grandchild templatestyles}} take the pagename of a [[WP:TemplateStyles|TemplateStyles]] page and turn it into a TemplateStyles tag. The TemplateStyles tag is a much more powerful way to add styling to an infobox. Some rules of use: # Always add a template-specific class in {{para|bodyclass}} so that the styles added to one infobox will not "leak" into another infobox. For example, [[Template:Infobox settlement]] has {{para|bodyclass|ib-settlement}} and the [[Template:Infobox settlement/styles.css]] page targets <code>.ib-settlement</code> for all of its added styling. # Do not assume Template:Infobox will continue to have a table structure (i.e., do not target <code>table</code> or any other table HTML in the TemplateStyles page). The table structure is soft-deprecated and will go away at some point in the future. These tags are loaded in this order: Horizontal list templatestyles ([[Template:Hlist/styles.css]]), unbulleted list templatestyles ([[Template:Plainlist/styles.css]]), core templatestyles ([[Module:Infobox/styles.css]]), templatestyles, child, and then grandchild, which can be used to 'cascade' the styles. ; templatestyles : This parameter is intended for a template or module calling {{tl|Infobox}} directly. ; child templatestyles : This parameter is intended for a template or module which calls an infobox with {{para|templatestyles}}. ; grandchild templatestyles : This parameter is intended for a template or module which calls an infobox with {{para|child templatestyles}}. The canonical list of classes output with each kind of element of an infobox (i.e. output for all {{para|data<sub>n</sub>}}, or all cases of {{para|above}}) can be found in [[Module:Infobox]] in the "addClass" rows. The below is a non-authoritative but otherwise sufficient list for most generic styling: {{div col}} ; .infobox : The top-level infobox class. ; .infobox-title : The class associated with a {{para|title}}. ; .infobox-above : The class associated with a {{para|above}}. ; .infobox-image : The class associated with a {{para|image<sub>n</sub>}}. Every image will have this class. ; .infobox-caption : The class associated with a {{para|caption<sub>n</sub>}}. Every caption will have this class. ; .infobox-header : The class associated with a {{para|header<sub>n</sub>}}. Every header will have this class. ; .infobox-subheader : The class associated with a {{para|subheader<sub>n</sub>}}. Every subheader will have this class. ; .infobox-label : The class associated with a {{para|label<sub>n</sub>}}. Every label will have this class. ; .infobox-data ; .infobox-full-data : The classes associated with {{para|data<sub>n</sub>}}. Every data row will have one of these classes, depending on whether the specific data has a label. ; .infobox-below : The class associated with a {{para|below}}. ; .infobox-navbar : The class associated with a {{para|navbar}}. {{div col end}} ==== Example TemplateStyles parameter use ==== For an example of an infobox which does not need to support children templates of its own (whether because it has no children or because it wants no children): <syntaxhighlight lang="wikitext"> {{Infobox | title = Child Example | bodyclass = ib-example | templatestyles = Template:Infobox/example/styles.css }} </syntaxhighlight> For an example of an infobox which does have its own children and an example of one of the children (grandchild templates have a similar use): <div style="display: flex"> <syntaxhighlight lang="wikitext"> {{Infobox | title = {{{title|Title Child Example}}} | bodyclass = ib-example {{{bodyclass|}}} | templatestyles = Template:Infobox/example/styles.css | child templatestyles = {{{child templatestyles|}}} }} </syntaxhighlight> <syntaxhighlight lang="wikitext"> {{Infobox/child example | title = Title Grandchild Example | bodyclass = ib-child-example | child templatestyles = Template:Infobox/child example/styles.css }} </syntaxhighlight> </div>
Summary:
Please note that all contributions to ARC Technical Repository may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
ARC Technical Repository:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)