Home > Web Front-end > CSS Tutorial > How to adjust character spacing in css

How to adjust character spacing in css

王林
Release: 2023-01-06 11:13:34
Original
6441 people have browsed it

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.

How to adjust character spacing in css

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template