When writing the HTML template, sometimes the space is used as a means of typing. The most common situation is to insert space between a paragraph to separate the relatively independent vocabulary. However, in the face of this situation, generally do not use ordinary spaces (half -angle spaces, that is, the space input directly input under the English input method), because when we expect to enter a few such spaces in a row to make a period of blank, the actual eventually eventually finally finally finally finally. The blank size displayed on the webpage is only the size of one space, so it is usually used to replace the half -angle space, which continuously input multiple gaps will generate the corresponding quantity. In addition to, in addition to, Unicode also defines a large number of different characteristics, including space characters in HTML entity forms. This article is to study these are relatively less noticed spaces and their characteristics.
2. There are HTML physical forms in unicodeHere are the spaces of HTML entity in Unicode and the blank effects it produced:
These spaces can be divided into three categories according to the characteristics: 1. Do not change the spaceThere is only one type without changing the space. The main feature is that it will not be judged by the browser as an interruption in the middle, which is also the main purpose created. Here is a short introduction:
is the Entity used to reply a non-Breaking Space. It is Essentially A Standard Space, The Primary Difference Being that A Browser Should Not Break (or Wrap) a Of text at the point that this occupies.
For example, this is a test for non-blocking Space. If the space between words use half-angle space and place it in a container with just inadequate width, the word Space will be changed separately because of insufficient width. Essence
If you want to change Breaking and Space at the same time, you only need to replace the half -angle space between Breaking and Space::
It can be seen that-such ordinary characters will still be considered by the browser as the division of words, and because some connections between Breaking and Space will not be interrupted, the browser will think that they are connected and complete Words, replace them at the same time when they are allowed to be at the same time.
It should be noted that if the spaces in a large number of English text are used, then the browser cannot correctly identify which character is the beginning and end of the word. In the end, the CSS attributes that are opened or changed are difficult to avoid disconnecting words in the middle of the word, which is often not the result we want. Therefore, if there are a large number of continuous spaces between different words in paragraphs, the first space of these continuous spaces is best to use ordinary half -angle spaces to ensure that there is still a normal separation between words.
2. Follow the font size to generate the corresponding blank spaceThis type of space contains three space characters. These three spaces will generate corresponding blank size according to different font size, which are 1/2 em, 1EM, 1/6EM (sometimes designed as 1/5EM) wide. The specific performance of its blank size is as shown below:
Since Chinese is a equivalent font, it has a clear relationship with the blank size and the size of Chinese characters (one is equal to the width of half Chinese characters, and one is the width of a Chinese character). Therefore Used to control typesetting, such as:
3. Zero -wide conjoined word control spaceThat is, , these two space characters do not produce blank, can only control whether the characters are connected between the characters. These two characters are not printed (or "control characters), that is, the characters that will not affect the printing effect will not affect the printing effect. , Only character characteristics control. The so -called joint word is a common phenomenon in Western fonts, indicating that the two separate letters can be connected into new letters when connected. For example, in German, the continuous writing between F and L will become a new character, and the semantics corresponding to the entire word will also change or produce cases that do not conform to grammar. For example:
AUFLAGE (editor) is a German composite word, which is composed of two components: AUF (about) and LAGE. If you write this word directly on HTML, it is controlled by the browser directly, and the following effect will be produced:
F and L are connected, not in line with German grammatical specifications, so you need to insert a compulsory discontinuous word between the two letters. The effect is as follows:
It is worth noting that not all browsers are sensitive to and . At present, these two characters in Chrome (44.0.2403.125) can not produce controls or non -word control, while Safari (8.0.6) It can effectively control the connection.
In the end, it is important to emphasize that although the spaces of different characteristics in Unicode can be used for typography, theoretically should not be typed with a space. The typesetting should be controlled by CSS. The space for typography does not belong to the content. But it is actually not conducive to maintenance with the content. Only when it is not easy to use CSS (such as in EML) and other special circumstances, consider using spaces to participate in typography.
The above is the characteristics and expression forms of the different spaces of HTML introduced by Xiaobian (recommendation). I hope it will be helpful to everyone. If you have any questions, please leave me a message. Xiaobian will reply to everyone in time. Thank you very much for your support for the VEVB Wulin website!