模板:Nowrap/doc:修订间差异
来自康健生活
创建页面,内容为“<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{Uses TemplateStyles|Template:Nowrap/styles.css}} {{tlx|Nowrap}} or {{tlx|nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence…” |
无编辑摘要 |
||
| (未显示同一用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
{{tlx|Nowrap}} or {{tlx|nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content. | {{tlx|Nowrap}} or {{tlx|nowrap}} stops wrapping of specific text. It prevents word wraps (line breaks) within text or inside a link which contains spaces, hyphens ("-"), or, in some browsers, parentheses. The size of the nowrapped text becomes the minimum width of that paragraph and that can negatively influence the ability of the page to adapt to smaller screens, or alternate representations of the content. | ||
| 第48行: | 第46行: | ||
== Technical details == | == Technical details == | ||
The actual code that does the job is this HTML | The actual code that does the job is this HTML <nowiki><span></nowiki> tag that applies a class to the text inside the template: | ||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
| 第54行: | 第52行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The class <code>nowrap</code> receives the CSS property <syntaxhighlight lang="css" inline>white-space: nowrap;</syntaxhighlight> in | The class <code>nowrap</code> receives the CSS property <syntaxhighlight lang="css" inline>white-space: nowrap;</syntaxhighlight> in <nowiki>MediaWiki:Common.css</nowiki>. | ||
== TemplateData == | == TemplateData == | ||
<templatedata> | <templatedata> | ||
{ | { | ||
| 第84行: | 第82行: | ||
} | } | ||
</templatedata> | </templatedata> | ||