Template:Inline block
Sarna News
- HEXTECH Review - Wave 3 Brings More Urban Options To Your Battlefield
- Your BattleTech News Round-Up For March, 2024
- Crashing 'Mechs With Jennifer Brozek, Author Of The Rogue Academy Trilogy
- Getting The Word Out With Rem Alternis, Catalyst Community & Marketing Director
- Bad 'Mechs - Yeoman
- Read more →
Usage[edit]
The template {{Inline block}} creates an element—by default a <span>
—that has the CSS property display:inline-block
. There is support for a range of common style properties as template parameters, and an all-purpose style
parameter.
One intended use is to replace {{nowrap}} when coding templates with complex layout, which need to display differently on mobile and desktop. Like {{nowrap}}, it holds content together and avoids wrapping it where possible. However, if necessary, such as on small screens, the content will wrap.
TemplateData[edit]
TemplateData for Inline block
The template {{Inline block}} creates an inline-block element. Among other uses, it can replace {{tl|nowrap}} when coding templates with complex layout.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Content | 1 | The content to be wrapped in an inline-block element | Content | optional |
Tag name | 2 | Changes the HTML tag used. This may affect what elements this template should contain or be contained by.
| String | optional |
Title | title | Title of the content (used as tooltip text, or expanded abbreviation when 2=abbr
| String | optional |
Width | width | The width; passed directly to the "width" [[CSS]] attribute | String | optional |
Height | height | The height; passed directly to the "height" CSS attribute | String | optional |
Text color | color | The text color; passed directly to the "color" CSS attribute | String | optional |
Background formatting | background bg | The background formatting; passed directly to the "background" CSS attribute | String | optional |
Other styles | style | Style information as plain CSS. | String | optional |
See also[edit]
- {{nowrap}} prevents wrapping within a single template (i.e. not suitable for relatively complex or lengthy content).
- {{nowraplinks}} ... {{nowraplinks end}} prevents wraps inside links while allowing wraps between links and in normal text. Very useful for link lists and easy to use.
- {{nowrap begin}} ... {{nowrap end}} prevents wraps in both text and links. For the trickier wrapping cases when you need full control, for instance in very complex link lists.
- {{avoid wrap}} prevents wraps unless the space is too narrow to display the text on one line.
- {{inline block}} does the same and allows further style customization, but does not automatically add the "avoidwrap" CSS class.
- {{spaces}} produces multiple non-breaking spaces (or a single one).
- {{wrap}} can be used to provide a (brief) exception within a no-wrapping area.
- {{normalwraplink}} allows links to wrap when they otherwise would not.
- {{·}} and {{•}}, spaced and wrap-sensitive interpunct (dot) and bullet.
- Help:Line break handling, our how-to guide about word wrapping and line breaks.
- In particular, to avoid line wrapping when quoting a passage such as a poem or computer code, see Template:Quote § Line breaks – e.g. Template:Blockquote with "poem" tag.