In CSS, you can use the letter-spacing attribute to adjust the spacing between Chinese characters. The function of this attribute is to increase or decrease the space between characters, that is, to set the character spacing; you only need to add "letter" to the Chinese text elements. -spacing: spacing value" style is enough.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
In CSS, you can use the letter-spacing attribute to adjust the spacing of Chinese characters.
The letter-spacing attribute can increase or decrease the space between characters, that is, set the character spacing.
The letter-spacing property defines how much space is inserted between text character boxes. Because character glyphs are typically narrower than their character boxes, specifying a length value adjusts the usual spacing between letters. Therefore, normal is equivalent to a value of 0.
Note: Negative values are allowed, which will squeeze the letters closer together.
Example:
<!DOCTYPE html> <html> <head> <style type="text/css"> .css2 { letter-spacing: 1em; } .css3 { letter-spacing:-3px; } </style> </head> <body> <p class="css1">这是一段文字,正常字间距</p> <p class="css2">这是一段文字,字间距为1em</p> <p class="css3">这是一段文字,字间距为-3px</p> </body> </html>
(Learning video sharing: css video tutorial)
The above is the detailed content of How to adjust Chinese text spacing in css. For more information, please follow other related articles on the PHP Chinese website!