Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template:Nowrap mobile begin/doc

From Wikipedia, the free encyclopedia

This template prevents word wraps (line breaks) in text and links with spaces in. It is designed to handle deep-nesting lists whose rightmost elements would otherwise display on mobile as a column of letters. It works similarly to {{nowrap}}, {{nowrap begin}} and {{nowraplinks}}. This template takes no parameters; instead, it works in tandem with {{nowrap mobile end}}.

Usage

[edit]
{{nowrap mobile begin}}

* A
** very
*** deep
**** nesting
***** list
****** that
******* shouldn't
******** wrap
********* on
********** mobile

{{nowrap mobile end}}

{{Nowrap mobile begin}} and {{Nowrap mobile end}} place their contents in a div with the class nowrap-mobile, set to display with the CSS property white-space: nowrap; for screens with a width of up to 639px. While the MediaWiki guidelines for mobile display recommend supporting a width of up to 1119px, intermediate widths handle image collision differently and will lead to unexpected behavior.

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.
  • {{nowrap mobile begin}} ... {{nowrap mobile end}} has the same effect for mobile viewports specifically. Useful for deeply nested lists.
  • {{word joiner}} prevents wraps for both two adjacent characters.
  • {{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, Wikipedia's 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.