The way to adjust the word spacing in CSS is to use the letter-spacing attribute, such as [letter-spacing:6px]. The letter-spacing property can increase or decrease the space between characters.
The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.
CSS provides us with a special attribute letter-spacing to adjust the spacing between characters.
The letter-spacing property increases or decreases the space between characters (character spacing).
Attribute value:
normal Default. Specifies no extra space between characters.
#length defines the fixed space between characters (negative values are allowed).
#inherit Specifies that the value of the letter-spacing attribute should be inherited from the parent element.
The specific implementation code is as follows:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>p文字间距 CSS5</title> <style> .jianju{ letter-spacing:6px} </style> </head> <body> <p>第一段:内容<br /> 换行形式,我是第一段的内容</p> <p class="jianju">第二段:内容,我被设置字间距6px</p> </body> </html>
Related video tutorial: css video tutorial
The above is the detailed content of How to adjust character spacing in css. For more information, please follow other related articles on the PHP Chinese website!