Template:Inline block/doc
![]() | 当前模板的内容正在依照的内容进行翻译。(2019年6月6日) 如果您熟知条目内容并擅长翻译,欢迎协助改善或校对此模板,目前的翻译进度为0%。长期闲置的非中文内容可能会被移除。 |
Edit-copy green.svg | 本文档是Template:Inline block的文档子页面 (见模板页自身)。 本页包含用法信息、分类和其他非原模板页面的内容。 |
用法
The template Template:Tlf 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 Template:Tlf, it holds content together and avoids wrapping it where possible. However, if necessary, such as on small screens, the content will wrap.
Example of wrapping control[编辑]
In each case the outline represents a width constraint, which might be affected by the user's screen size, other parts of the template, or both.
Here, each grey box and the text "Color of ..." are wrapped in Template:Tlf templates. If Template:Tlf had been used instead, there would be no visible difference in the first two cases. In the third case, however, the text would have been unable to wrap into the space available. On mobile, this might mean that a table or the whole article is forced to become horizontally scrollable.
参数[编辑]
参见[编辑]
Template:List of nowrap-like templates