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

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

不言
不言Original
2018-10-08 11:35:269044browse

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>

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!

Statement:
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