Template:Heading/sandbox
Default heading
![]() | This is the template sandbox page for Template:Heading (diff). See also the companion subpage for test cases. |
Template to create HTML headings with variable and adjustable styles.
Usage
[edit]{{heading|Text}}
{{heading|Text|Level|style|style|style|style|style|style|style|style|style|style}}
Parameters
[edit]All parameters are unnamed. The first two parameters are used to define the basic heading, the next ten control the styling.
General
[edit]- 1: Text of the heading. Default:
Default heading
- 2: Level of the heading. Can be entered as any number from 1 to 6 or the codes h1 to h6. Default:
h3
Styling
[edit]This template uses a sub-routine to parse a series of shorthand codes into the appropriate styles. This shorthand can be seen in the table below. Up to ten codes can be entered. A few codes will apply more than one property.
Note: The headings will inherit the standard MediaWiki styling for their level by default. This needs to be over-ridden with the appropriate codes if an alternative is desired.
Shorthand code(s) |
Natural-language code(s) |
CSS property | CSS value | Description |
---|---|---|---|---|
fwn |
normal notbold |
font-weight | normal | Removes bold-text styling from the heading |
b fwb |
bold |
font-weight | bold | Adds bold-text styling to the heading |
fsn |
roman noitalic |
font-style | normal | Removes italic-text styling from the heading |
i fsi |
italic italics |
font-style | italic | Adds italic-text styling to the heading |
std |
standard |
font-size | 1em | Sets the size of the text as equivalent to the normal body text |
xxs |
xx-smaller |
font-size | 0.58em | Sets the size of the text as equivalent to the {{xx-smaller}} template |
xs |
x-smaller |
font-size | 0.69em | Sets the size of the text as equivalent to the {{x-smaller}} template |
sm |
smaller |
font-size | 0.83em | Sets the size of the text as equivalent to the {{smaller}} template |
lg |
larger |
font-size | 1.2em | Sets the size of the text as equivalent to the {{larger}} template |
xl |
x-larger |
font-size | 1.44em | Sets the size of the text as equivalent to the {{x-larger}} template |
xxl 2xl |
xx-larger |
font-size | 1.82em | Sets the size of the text as equivalent to the {{xx-larger}} template |
xxxl 3xl |
xxx-larger |
font-size | 2.07em | Sets the size of the text as equivalent to the {{xxx-larger}} template |
xxxxl 4xl |
xxxx-larger |
font-size | 2.49em | Sets the size of the text as equivalent to the {{xxxx-larger}} template |
lh0 |
height0 height1 |
line-height | 1em | Sets the line height |
lh06 |
line-height | 0.6em | Sets the line height | |
lh09 |
line-height | 0.9em | Sets the line height | |
lh12 |
line-height | 1.2em | Sets the line height | |
lh15 |
line-height | 1.5em | Sets the line height | |
lh2 |
line-height | 2em | Sets the line height | |
mt0 |
margin-top | 0em | Removes all empty space above the heading | |
mt01 |
margin-top | 0.1em | Sets some empty space above the heading | |
mt02 |
margin-top | 0.2em | Sets some empty space above the heading | |
mt03 |
margin-top | 0.3em | Sets some empty space above the heading | |
mt04 |
margin-top | 0.4em | Sets some empty space above the heading | |
mt05 |
margin-top | 0.5em | Sets some empty space above the heading | |
mt06 |
margin-top | 0.6em | Sets some empty space above the heading | |
mt07 |
margin-top | 0.7em | Sets some empty space above the heading | |
mt08 |
margin-top | 0.8em | Sets some empty space above the heading | |
mt09 |
margin-top | 0.9em | Sets some empty space above the heading | |
mt1 |
margin-top | 1em | Sets some empty space above the heading | |
mb0 |
margin-bottom | 0em | Removes empty space (margin) below the heading | |
mb01 |
margin-bottom | 0.1em | Sets some empty space below (but excluding) the heading | |
mb02 |
margin-bottom | 0.2em | Sets some empty space below (but excluding) the heading | |
mb03 |
margin-bottom | 0.3em | Sets some empty space below (but excluding) the heading | |
mb04 |
margin-bottom | 0.4em | Sets some empty space below (but excluding) the heading | |
mb05 |
margin-bottom | 0.5em | Sets some empty space below (but excluding) the heading | |
mb06 |
margin-bottom | 0.6em | Sets some empty space below (but excluding) the heading | |
mb07 |
margin-bottom | 0.7em | Sets some empty space below (but excluding) the heading | |
mb08 |
margin-bottom | 0.8em | Sets some empty space below (but excluding) the heading | |
mb09 |
margin-bottom | 0.9em | Sets some empty space below (but excluding) the heading | |
mb1 |
margin-bottom | 1em | Sets some empty space below (but excluding) the heading | |
pb0 |
padding-bottom | 0em | Removes empty space (padding) below the heading | |
pb01 |
padding-bottom | 0.1em | Sets some empty space below (and including) the heading | |
pb02 |
padding-bottom | 0.2em | Sets some empty space below (and including) the heading | |
pb03 |
padding-bottom | 0.3em | Sets some empty space below (and including) the heading | |
pb04 |
padding-bottom | 0.4em | Sets some empty space below (and including) the heading | |
pb05 |
padding-bottom | 0.5em | Sets some empty space below (and including) the heading | |
pb06 |
padding-bottom | 0.6em | Sets some empty space below (and including) the heading | |
pb07 |
padding-bottom | 0.7em | Sets some empty space below (and including) the heading | |
pb08 |
padding-bottom | 0.8em | Sets some empty space below (and including) the heading | |
pb09 |
padding-bottom | 0.9em | Sets some empty space below (and including) the heading | |
pb1 |
padding-bottom | 1em | Sets some empty space below the (and including) heading | |
c |
centre center |
text-align | center | Centres the heading |
l |
left |
text-align | left | Aligns the heading to the left |
r |
right |
text-align | right | Aligns the heading to the right |
b0 |
noborder |
border | none | Removes all borders from the heading (including the underline) |
bso |
solid |
border-bottom-style | solid | Applies a solid border beneath the heading |
bdo |
dotted |
border-bottom-style | dotted | Applies a dotted border beneath the heading |
bda |
dashed |
border-bottom-style | dashed | Applies a dashed border beneath the heading |
bdb |
double |
border-bottom-style | double | Applies a double border beneath the heading |
b1 |
border-bottom-width | 1px | Sets the border/underline at 1 pixel wide | |
b2 |
border-bottom-width | 2px | Sets the border/underline at 2 pixels wide | |
b3 |
border-bottom-width | 3px | Sets the border/underline at 3 pixels wide | |
col170 |
greyline grayline |
border-bottom-color | AAAAAA | Sets the border/underline colour to (almost) dark medium gray |
col0 |
blackline |
border-bottom-color | 000000 | Sets the border/underline colour to black |
fs |
serif |
font-family | serif | Sets heading font to a serif style |
fss sans |
sansserif sans-serif |
font-family | sans-serif | Sets heading font to a sans serif style |
fw |
wikifont |
font-family | 'Linux Libertine', Georgia, Times, serif | Mimics the font of a MediaWiki level-1 or level-2 header |
nomargin margin0 nospace |
Removes all empty space (both margins and padding) from the heading | |||
basic |
Removes both italic and bold styling | |||
n |
neutral |
Removes italic, removes bold, removes border, uses standard font size and sans serif style | ||
u |
h2border underline |
Mimics the standard underline of a MediaWiki level-2 header |
Examples
[edit]{{heading|This is an example|4}}
This is an example
{{heading|This is another example|4|basic}}
This is another example
{{heading|Yet another example||centre|italic}}
Yet another example
Notes
[edit]Headers created with this template:
- Do appear in the automatic table of contents (TOC).
- — but not if they are transcluded from another page using
<pages />
(direct transclusion, ie.{{Page:Foo/n}}
, will work as normal) - — except in mobile view (
en.m.wikisource.org
), where it will generate a TOC regardless of transclusion method.
- — but not if they are transcluded from another page using
- Do act as anchors and display the § link.
- Do not have [edit] links.
- Are not collapsible in mobile view.
- — except when directly transcluded (ie.
{{Page:Foo/n}}
)
- — except when directly transcluded (ie.
See also
[edit]Similar
[edit]- {{table style}}
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
1 | 1 text | text of heading line | Unknown | required |
2 | 2 | Heading level (i.e number of = characters at start and end) | Number | required |
3 | 3 | no description | Unknown | optional |
4 | 4 | no description | Unknown | optional |
5 | 5 | no description | Unknown | optional |
6 | 6 | no description | Unknown | optional |
7 | 7 | no description | Unknown | optional |
8 | 8 | no description | Unknown | optional |
9 | 9 | no description | Unknown | optional |
10 | 10 | no description | Unknown | optional |
11 | 11 | no description | Unknown | optional |
12 | 12 | no description | Unknown | optional |
class | class | CSS classes to apply to this heading | Unknown | optional |
title | title | no description | Unknown | optional |
@ | @ | title or id to use as an anchor for linking to this heading | String | optional |