CSS word-spacing

The word-spacing property in CSS is used to specify the spacing between words in a text. It can be applied to any element that contains text content.

The value of word-spacing property can be set in different units, such as pixels, ems, or percentage.

Let's see an example to better understand how word-spacing works:

Result:

This is a sample text.

In the example above, the word-spacing is set to 10px, which creates a space of 10 pixels between each word in the text "This is a sample text".

Now, let's see another example with different unit:

Result:

This is another example text.

In this example, the word-spacing is set to 0.5em, which creates a space of 0.5 times the font size between each word in the text "This is another example text".

You can also use percentage as a unit for word-spacing. For example:

Result:

This is a third example text.

In this example, the word-spacing is set to 20%, which creates a space of 20% of the font size between each word in the text "This is a third example text".