{{{1}}}
This template uses TemplateStyles: |
Property |
Internet Explorer |
Firefox | Safari | Chrome | Opera |
---|---|---|---|---|---|
column-width column-count |
≥ 10 (2012) |
≥ 1.5 (2005) |
≥ 3 (2007) |
≥ 1 (2008) |
≥ 11.1 (2011) |
columns | ≥ 10 (2012) |
≥ 9 (2011) |
≥ 3 (2007) |
≥ 1 (2008) |
≥ 11.1 (2011) |
break-before break-after break-inside |
≥ 10 (2012) |
≥ 65 (2019) |
≥ 10 (2016) |
≥ 65 (2016) |
≥ 15 (2013) |
This template is for creating headings that are designed to work well with CSS columns, such as those generated by {{ div col}} and {{ columns-list}}. Using this template prevents the heading from being placed at the very bottom of a column, which is usually undesirable.
With the optional force
parameter, you can also force a column break to occur immediately before this heading. This can be useful if you have two semi-related lists that you want to put in the same set of columns without allowing them to mi (for example, you might use it in a sports roster to separate the players from the staff).
{{col head|Your heading here}}
{{col head|Your heading here|type=|force=y|style=|class=}}
|type=
bold
(default): Creates a pseudo-heading with bold text '''Your heading here'''
strong
, b
h1
, h2
, ..., h6
: Creates a section heading h4
→ ==== Your heading here ====
1
, 2
, ... 6
term
: Creates a dt
element, for use as a term in a
glossary bold
option instead.; Your heading here
dt
none
: Creates a div
element with unstyled text Your heading here
div
, n
|force=y
|style=
|class=
As of June 2020,
[update] there are no browsers with CSS support for break-after: avoid-column
, so this template uses a hacky workaround with break-inside: avoid-column
to emulate that behavior. This workaround results in two edge case bugs (though they're both unlikely to occur in normal use cases for this template).
If the height of your columns container is less than 5em (equal to 70px at normal font size in the Vector theme), 5em=70px), the browser will think that your {{col head}} is taller than the container. Chrome handles this by simply making the container taller, which looks fine. Firefox, on the other hand, ends up placing subsequent elements in very weird positions on the page, which looks very bad.
In general, avoid using this template in very short columns boxes. It seems unlikely that you would need this template in such a scenario anyway; with so little content, you would likely be better off using fixed or float columns rather than CSS columns.
If a heading is immediately followed by an element that has a height of at least 5em and cannot have a break inside it (such as an element with break-inside: avoid-column
), it would likely cause the column breaks to be inserted in odd places (this has not been tested). This means this template may not play nicely with large unbreakable elements such as images, but most typically-formatted elements should be fine.
TemplateData for Col head
This template is for creating headings that are designed to work well with CSS columns, such as those generated by {{div col}} and {{columns-list}}. Using this template prevents the heading from being placed at the very bottom of a column, which is usually undesirable.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | 1 | The text to be used for your heading | Content | required |
Type | type | The style of heading to use. Options: h1, h2, ..., h6, bold, term, none
| Line | optional |
Force column break? | force | If set to any value, a column break will occur immediately before this heading (meaning this heading will be placed at the top of the next column) | Boolean | optional |
Style | style | Additional CSS to apply to the heading tag
| String | optional |
Class | class | Additional CSS class(es) to add to the heading tag | String | optional |