CSS word-spacing properties and usage
The CSS word-spacing property is used to design the horizontal distance between words on a web page. The usage is similar to letter-spacing , except that word-spacing controls words (or paragraphs) instead of single letters, while letter-spacing controls The distance between single characters. Another feature of the CSS word-spacing property is that when encountering Chinese characters, white space is regarded as the separation of words. For example, "Good morning and hello" will be regarded as a single word, and "Good morning and hello" will be It is treated as two words because there is an extra space in the middle. A more complete effect will be presented in an example later. Almost all mainstream browsers support the effect of the CSS word-spacing property. The following are the basic grammatical rules.
CSS word-spacing basic syntax
- word-spacing: normal; //The default value, the horizontal distance between words or paragraphs is the default effect.
- word-spacing: length; //Design additional horizontal distance between words or paragraphs, available units such as cm, em, px... etc.
- word-spacing:inherit; //The word-spacing attribute value inherited from the parent layer.
CSS word-spacing example
<div style=" word-spacing: 30px; border:2px #ccc solid;"> Good morning, John.</div>
<div style=" word-spacing: 30px; border:2px #ccc solid;">This is a test example. This is a test example. This is a test example</div>
Post a Comment
0 Comments