How to make the distance between words in CSS
Learn how to adjust word spacing in CSS with an example. Easily add extra space between words for a polished look.
How to Change the Space Between Words using CSS
Using the CSS letter-spacing property, you can easily adjust the space between words in your HTML content. This can be useful for creating a professional-looking website, to make the text easier to read, or to make it stand out.
The letter-spacing property can be used to adjust the space between words. It accepts a value in terms of points or pixels.
p {
letter-spacing: 1.5px;
}
The above CSS rule will add 1.5 pixels of space between each word in the HTML element with the p
tag.
You can also adjust the space between characters by using the CSS word-spacing
property. This property also accepts a value in terms of points or pixels.
p {
word-spacing: 3px;
}
The above CSS rule will add 3 pixels of space between each character in the HTML element with the p
tag.
Both the letter-spacing
and word-spacing
properties can be used to adjust the spacing between words and characters, respectively. By using the appropriate values, you can easily create a professional-looking website or make your text easier to read.