Content deleted Content added
→{{nowrap}}: +hatnote |
|||
(27 intermediate revisions by 10 users not shown) | |||
Line 9:
===Newlines===
{{see|Wikipedia:
{{shortcut|H:PARAGRAPH}}
▲{{see|Wikipedia:Don't use line breaks|Wikipedia:Manual of Style#Controlling line breaks}}
There are several ways to force [[newline|line breaks]] and [[hard return|paragraph breaks]] in the text. The simplest method is by inserting newlines; for example:
Line 36:
}}
===
{{shortcut|H:BR}}{{anchor|<br> or <br />|br|br/|br /}}
<code><nowiki><br></nowiki></code>, <code><nowiki><br ></nowiki></code>, <code><nowiki><br/></nowiki></code>, <code><nowiki><br /></nowiki></code>
The {{tag|br|s}} or {{tag|br|o}} tags are used for a single forced line break. For content that is semantically a list, such as in infoboxes, actual list markup is preferred. See {{format link|#Lists}} below.▼
The [[MediaWiki]] software uses any of them for a single forced line break. All of them are converted to {{tag|br|s}} in the HTML that browsers read.
MediaWiki also converts <code><nowiki></br></nowiki></code> to {{tag|br|s}}, but this form is invalid. Please correct these tags.
▲
{{markup
|<nowiki>And this line of text<br
|And this line of text<br
}}
The example below includes four forms that are rendered as line breaks and two that display as plain text.
<div style="display:inline-table; border: 2px solid var(--border-color-content-added); padding: 0.5em;">
'''Wiki source'''
<nowiki>One <br>Two <br >Three <br/>Four <br />Five < br>Six </ br>Seven</nowiki>
</div>
<div style="display:inline-table; border: 2px solid var(--border-color-content-added); padding: 0.5em;">
'''Rendered result'''
One <br>Two <br >Three <br/>Four <br />Five < br>Six </ br>Seven
</div>
=== <poem> ===
Line 216 ⟶ 229:
== Preventing and controlling word wraps ==
{{Nutshell|title=This section|To prevent word wraps use <code>&nbsp;</code> in place of each space
There are several ways to prevent word wraps (line wraps) from occurring in unwanted places. This is an overview of when to use which method.
Line 334 ⟶ 347:
:< 3
=== <wbr
{{anchor|wbr|<wbr>}}
To insert a word-break opportunity, use {{tag|wbr|o}}.
It specifies where it would be OK to add a line-break where a word is too long, or it is perceived that the browser will break a line at the wrong place. Whether the line actually breaks is then left up to the browser. The break will look like a space - see soft hyphen below when it would be more appropriate to break the word or line using a hyphen.
{{markupv
|markup=<nowiki>Now is the time to become a power editor, by learning Hyper<wbr
|renders=It may render like this:
:Now is the time to become a power editor, by learning HyperText Markup Language...
Line 349 ⟶ 364:
}}
Note that {{tag|wbr|
In many cases breaking up a word with a space would be inappropriate. [[Soft
The code <code>&shy;</code> is employed in the same manner as {{tag|wbr|o}}. For example:
{{markup
|<nowiki>This long German word Datenschutz&shy;erklärung breaks between its constituent parts "Datenschutz" and "erklärung".</nowiki>
|This long German word Datenschutz­erklärung breaks between its constituent parts "Datenschutz" and "erklärung".
}}
Use of soft hyphens should be limited to special cases, usually involving [[Longest English words|very long words]] or narrow spaces (such as captions in [[infobox|infoboxes]] or other tight page layouts, or column labels in narrow tables). Widespread use of soft hyphens is strongly discouraged, because it makes the wikitext very difficult to read and to edit. For example:
Line 359 ⟶ 381:
|This Wikisource example is difficult to understand
}}
Consider instead using the {{tlx|shy}} template for such complex cases:
{{markup
Line 375 ⟶ 399:
== See also ==
* [[
* {{tl|break}}
* {{tl|clear}}
|