Word Spacing

CSS provides the ability to adjust the word spacing within your text. In other words, when creating a web page or blog, you can specify the space between each word in your text. This article shows you how to adjust the word spacing in your HTML documents.

To adjust the word spacing of your text, you need to use the CSS word-spacing property. The value that you provide determines the space between each word.

Below are some examples using different values for the word-spacing property.

Word Spacing Examples

Here are examples of the different value types that you can specify on the word-spacing property. For example, if you write word-spacing:3px;, you are specifying that there should be 3 extra pixels between each word.

Source CodeResult

Normal text: This text does not have its word-spacing specified. Therefore it uses a default value.

Adjusted word-spacing: This text has got word-spacing value of 8 pixels.

Adjusted word-spacing: This text has got word-spacing value of 0.4 centimeter.

Adjusted word-spacing: This text has got word-spacing value of 1em.

Adjusted word-spacing: This text has got word-spacing value of negative 2 pixels.

Adjusted word-spacing: This text has got word-spacing value of negative 0.1 centimeter.

Adjusted word-spacing: This text has got word-spacing value of negative 0.8em.

About the HTML Codes

The HTML code on this page is provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

External Style Sheets

Most of the HTML codes on this website use inline CSS. If you intend to use the codes across your whole website, you should place the CSS into an external style sheet.

To learn more, check out this explanation of external style sheets.

Web Hosting

Our partner site, ZappyHost, is a professional web hosting company providing website hosting, domain names and related products. If you need web hosting, check them out!