Home > Web Front-end > CSS Tutorial > How to adjust css font spacing? How to adjust css text spacing

How to adjust css font spacing? How to adjust css text spacing

不言
Release: 2018-10-08 11:35:26
Original
9106 people have browsed it

In the process of front-end development, sometimes words may appear to be relatively compact, which will make the page look unsightly. So how to solve this problem? We should be able to think of setting the text spacing through css to make the distance between words larger. This will be more in line with the design of the page layout and make the page more beautiful. Then, the following This article will introduce to you the method of css font spacing adjustment. Friends in need can refer to it.

The way to solve the spacing between words in css is to use the css style attribute letter-spacing. The letter-spacing attribute is used to adjust the spacing between words, that is, the distance between characters.

Let’s take a look directly at the usage of the css text spacing attribute letter-spacing.

For example, letter-spacing:20px; sets the distance between words to 15px.

css font spacing adjustment code:

<html>
<head>
<style type="text/css">
p{font-size:20px;
letter-spacing: 20px
}
</style>
</head>
<body>
<p>php中文网文字间隔</p>
</body>
</html>
Copy after login

css font spacing adjustmentThe effect is as follows:

How to adjust css font spacing? How to adjust css text spacing

Note: If setting the word spacing has no effect, check whether the div is at the wrong level; we can also set the line spacing through line-height.

The above is the entire content of this article. For more information about the css text spacing attribute letter-spacing, you can refer to css User Manual for further learning.

The above is the detailed content of How to adjust css font spacing? How to adjust css text spacing. 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