词条 | Non-breaking space | ||||||||||||||||||||||||||||||||||||||||||||||
释义 |
In word processing and digital typesetting, a non-breaking space (" "), also called no-break space, non-breakable space (NBSP), hard space, or fixed space,{{NoteTag|The use of the term "fixed space" for no-break space is strongly discouraged, as it is confusable with the term "fixed-width space".}} is a space character that prevents an automatic line break at its position. In some formats, including HTML, it also prevents consecutive whitespace characters from collapsing into a single space. In HTML, the common non-breaking space, which is the same width as the ordinary space character, is encoded as Non-breaking space characters with other widths also exist. Uses and variationsDespite having layout and uses similar to those of whitespace, it differs in contextual behavior.[1][2] Non-breaking behaviorText-processing software typically assumes that an automatic line break may be inserted anywhere a space character occurs; a non-breaking space prevents this from happening (provided the software recognizes the character). For example, if the text "100 km" will not quite fit at the end of a line, the software may insert a line break between "100" and "km". An editor who finds this behaviour undesirable may choose to use a non-breaking space between "100" and "km". This guarantees that the text "100 km" will not be broken: if it does not fit at the end of a line, it is moved in its entirety to the next line. Non-collapsing behaviorA second common application of non-breaking spaces is in plain text file formats such as SGML, HTML, TeX and LaTeX, whose rendering engines are programmed to treat sequences of whitespace characters (space, newline, tab, form feed, etc.) as if they were a single character (but this behavior can be overridden). Such "collapsing" of whitespace allows the author to neatly arrange the source text using line breaks, indentation and other forms of spacing without affecting the final typeset result.[3][4] In contrast, non-breaking spaces are not merged with neighboring whitespace characters when displayed, and can therefore be used by an author to simply insert additional visible space in the resulting output without using spans styled with peculiar values of the CSS “white-space” property. Conversely, indiscriminate use (see the recommended use in style guides), in addition to a normal space, gives extraneous space in the output. Width variationOther non-breaking variants, defined in Unicode:
Encodings
Unicode defines several other non-break space characters. See #Width variation. Encoding remarks:
Keyboard entry methodsIt is rare for national or international standards on keyboard layouts to define an input method for the non-breaking space. An exception is the Finnish multilingual keyboard, accepted as the national standard SFS 5966 in 2008. According to the SFS setting, the non-breaking space can be entered with the key combination AltGr + Space.[10] Typically, authors of keyboard drivers and application programs (e.g., word processors) have devised their own keyboard shortcuts for the non-breaking space. For example:
Apart from this, applications and environments often have methods of entering unicode entities directly via their code point, e.g. via the Alt Numpad input method. (Non-breaking space has code point 255 decimal (FF hex) in codepage 437 and codepage 850, and code point 160 decimal (A0 hex) in codepage 1252.) See also
Notes{{NoteFoot}}References1. ^{{Cite journal |doi = 10.3998/3336451.0013.105|title = Justify Just or Just Justify|journal = The Journal of Electronic Publishing|volume = 13|year = 2010|last1 = Elyaakoubi|first1 = Mohamed|last2 = Lazrek|first2 = Azzeddine}} {{DEFAULTSORT:Non-Breaking Space}}Spatie#Harde spatie2. ^{{cite web |url=http://www.chicagomanualofstyle.org/qanda/data/faq/topics/SpecialCharacters.html |title=Special Characters |publisher=The Chicago Manual of Style Online}} 3. ^{{Citation | chapter-url = http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#h-9.1 | publisher = W3 | date = 1999-12-24 | title = HTML 4.01 | chapter = Structure}}. 4. ^{{Citation | chapter-url = http://www.w3.org/TR/CSS21/text.html#white-space-prop | publisher = W3 | title = CSS 2.1 | chapter = Text}}. 5. ^ISO/IEC 10646-1:1993/FDAM 29:1999(E) 6. ^Mongolian NNBSP-connected suffixes 7. ^{{cite web |url=http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf |title=Zweisprachige Mikrotypografie |last1=Solbrig |first1=Amelie |date=30 January 2008 |website= |publisher=Hochschule für Technik, Wirtschaft und Kultur Leipzig |access-date=10 June 2018 |quote=Alle Abkürzungen mit Binnenpunkten werden im Deutschen mit einem gFL [geschütztes flexibles Leerzeichen] spationiert. [...] Die englische Schreibweise sieht keine Abstände zwischen einzelnen Buchstaben vor. Nach einem Binnenpunkt folgt demnach ohne gFL sofort der nächste Buchstabe. |language=German| archiveurl=https://web.archive.org/web/20160311073646/http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf | archivedate=2016-03-11 |page=58 (PDF p. 113) }} 8. ^{{cite web |title=Writing Systems and Punctuation |url=https://www.unicode.org/versions/Unicode7.0.0/ch06.pdf |work=The Unicode Standard 7.0 |publisher=Unicode Inc. |year=2014 |accessdate=2014-11-02}} 9. ^{{cite web |title=CLDR Chart: Numbers |url=https://www.unicode.org/cldr/charts/dev/by_type/numbers.symbols.html#a1ef41eaeb6982d}} 10. ^{{Citation | last = Kotoistus | url = http://www.csc.fi/sivut/kotoistus/nappaimisto.htm | title = Uusi näppäinasettelu | place = CSC – IT Center for Science | language = Finnish, English | date = 2006-12-28 | type = presentation | trans-title = Status of the new keyboard layout | deadurl = yes | archiveurl = https://web.archive.org/web/20110727024039/http://www.csc.fi/sivut/kotoistus/nappaimisto.htm | archivedate = 2011-07-27 | df = }}. Drafts of the Finnish multilingual keyboard. 3 : Control characters|Whitespace|Unicode formatting code points |
||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。