Home > Article > Web Front-end > How to set text spacing in CSS
The tutorial I bring to you today is how to use CSS to set the spacing between words. Let’s take a look at a practical case below.
The method of using CSS to solve the distance between words is as follows:
We use css styleAttributeletter-spacing:+ Distance number + html unit
For example, letter-spacing:15px; that is, the distance between words is set to 15px (pixels).
Example:
CSS code:
.p{letter-spacing:15px;}
HTML code:
<p class="p">实现字与字间距方法</p>
Distance between text
We can see from the picture above Set 15px word and word spacing effect
We use CSS letter-spacing to solve the distance between words, and the spacing between words-font spacing setting solves the style.
There are so many things to pay attention to. For more exciting content, please pay attention to php Chinese website Other related articles!
Related reading:
Answers to questions about camel case naming and JS
Boolean values, relational operators in JS, Detailed explanation and examples of logical operators
## Summary of the front-end js framework and explanation of its uses
The above is the detailed content of How to set text spacing in CSS. For more information, please follow other related articles on the PHP Chinese website!