Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the spacing between letters in a word by css

Shulou Source: shulou.com Published: 2022-06-02 15:04:45 09月19日 Update

This article introduces the relevant knowledge of "how to set the spacing of letters in css words". In the actual operation process of cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

In css, you can set the spacing of letters within a word using the "letter-spacing" attribute, which increases or decreases the spacing between characters by adding the "{letter-spacing: spacing value;}" style to the text element.

Operating environment of this tutorial: Windows 7 system, CSS3 && HTML5 version, Dell G3 computer.

Css how to set the spacing between letters in a word

Create a new html file named test.html to explain how css adjusts the distance between letters. Within the test.html file, create a line of text using the p tag for testing. Add the letter-spacing: spacing size; style to the p label.

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

This property defines how much space is inserted between text character boxes. Because character glyphs are usually narrower than their character boxes, specifying a length value adjusts the usual spacing between letters. Therefore, normal is equivalent to a value of 0.

Note: Negative values are allowed, which squeeze letters tighter together.

The code is as follows:

Document p{ letter-spacing:15px;}

you are beautiful

Output:

"CSS how to set the letter spacing within the word" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Tags: Letters spacing characters words between attributes content files text more tags styles knowledge adjustments output practical learned and then one line code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL NVidia Huawei Shulou Information