Home  >  Article  >  Web Front-end  >  How to make words equidistantly separated in css

How to make words equidistantly separated in css

王林
王林Original
2020-11-16 09:44:004483browse

How to separate words equally in CSS: You can use the letter-spacing attribute, such as [letter-spacing:10px;]. The letter-spacing property is used to increase or decrease the space between characters (character spacing).

How to make words equidistantly separated in css

The letter-spacing property increases or decreases the space between characters (character spacing).

(Video tutorial recommendation: css video tutorial)

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.

Specific code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style>
.p{letter-spacing:10px;}
</style>
</head>

<body>
<p>正常文本!</p>
<p class="p">设置了字间距的文本!</p>
</body>
</html>

Related recommendations: CSS tutorial

The above is the detailed content of How to make words equidistantly separated in css. 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