Navigation
  • Home
  • Recent
  • Most Active
  • Popular
  • Blog
  • Credits
  • RSS
  •   Interaction
  • Register
  • Statistics
  •   Help
  • Suggestions
  • Contact Us
  • How to Edit
  • Help



  • [Edit]


    A space character is a character used to represent a space. In proofreading, only em- and en-spaces are represented using this character (which they call an em-quad or an en-quad), while other types of spaces are represented with a number sign.

    In programming language syntax, spaces are frequently used to explicitly separate tokens. Aside from this use, spaces and other whitespace characters are usually ignored by modern programming languages. Exceptions are Haskell, ABC, and Python, which use the amount of whitespace in indentation to indicate the bounds of a block, and a whimsical language called Whitespace, where whitespace is the only meaningful syntactical element.

    In word processors and text editors, if a line on a screen is shorter than the width of the screen or window, then the empty space to the right usually does not correspond with space characters in the file: there is simply a code indicating that the next text should be put on a new line. Thus, the size of the file is not made unnecessarily larger. If there are space characters, one usually does not see the difference; text editors and word processors often have an option to make them visible. Also, if there is a space character, the cursor can move there, otherwise usually not.


        Space character
            Spaces and digital typography
                Space characters in markup languages
            Zero-width space
            See also

    top

    Spaces and digital typography

    In computer character encodings, the normal, general-purpose en-width space is Unicode character (32 decimal). When rendered, it is often considered insignificant when appearing at the end of a line of text, or when part of a sequence of whitespace characters, so it may be omitted or "collapsed" in such circumstances.

    The non-breaking space, (160 decimal), renders the same as a normal space but is expressly non-collapsible. It is often used to prevent line wrapping or to indent text, though some World Wide Web authorities discourage using it for those purposes.

    An em dash can optionally be surrounded with a so-called hair space, (8202 decimal). This space should be much thinner than a normal space, and is seldom used on its own. It can be written in HTML by using the numeric character reference &
      x200A; or &
        8202;. Unfortunately, very few user agents are able to render a hair space correctly: in most cases the result is an unwanted symbol or a question mark on the screen, depending on the font and renderer capabilities.



    Unicode defines several other space characters with specific semantics and rendering characteristics, as shown in the table below. Depending on the browser and fonts used to view this table, not all spaces may display properly:



    Unicode also provides some visible characters to stand in for space when necessary in the "Control Pictures" block: the Symbol For Space (U+2420), the Blank Symbol (U+2422), and the Open Box (U+2423).

    top

    Space characters in markup languages

    Space characters appearing in inconsequential places within element start tags in both XML and HTML are generally ignored by processors of those markup languages. For example, spaces that appear on either side of the "=" that separates an attribute name from its value have no effect on the interpretation of the document. Element end tags can contain trailing spaces, and empty-element tags in XML can contain spaces before the "/>".

    In XML attribute values, sequences of whitespace characters are treated as a single space when the document is read by a parser*. Whitespace in XML element content is not changed in this way by the parser, but an application receiving information from the parser may choose to apply similar rules to element content. An XML document author can use the xml:space="preserve" attribute on an element to force the parser to discourage the downstream application from altering whitespace in that element's content.

    In most HTML elements, a sequence of whitespace characters is treated as a single inter-word separator, which may manifest as a single space character when rendering text in a language that normally inserts such space between words.* Renderers are required to apply a more literal treatment of whitespace in certain elements, such as pre and any element for which CSS has been used to apply pre-like whitespace processing. In such elements, space characters will not be "collapsed" into inter-word separators.

    In both XML and HTML, the non-breaking space character is not treated as "whitespace", so it is not subject to the rules above.

    top

    Zero-width space

    A zero-width space &
      8203; is usually not visible, but it may expand in passages that are fully justified.

    In HTML pages this space can be used as a potential line-break in long words as a replacement for the deprecated tag. Since the zero-width space is not supported in all web browsers (most notably Internet Explorer) the following HTML code can be used as a workaround for this purpose:



    However, this code is not semantic markup, and thus should not be used in HTML code.

    top

    See also

     
    Search more:
     

       
    Source Privacy License Download Contact Us Atlas
    Scientus.org Dictionary (Yet Another Wiki) RC : 1.39
    This article is licensed under the GNU Free Documentation License [copyleft]. It uses material from the Wikipedia article "Space character". link