How To Change The Distance Between Words

Table of contents:

How To Change The Distance Between Words
How To Change The Distance Between Words

Video: How To Change The Distance Between Words

Video: How To Change The Distance Between Words
Video: How to change Word spacing in Word | Microsoft Word Tutorial 2024, May
Anonim

Changing the distance between words in the text of web pages is not as trivial as it might seem. Two, three or more consecutive spaces between adjacent words, according to the HTML language standards, will not affect the distance between them in any way - the browser will display them as a single space. But, of course, there are tools for solving this problem.

How to change the distance between words
How to change the distance between words

Instructions

Step 1

One option is to use a special HTML character called non-breakable-space. It is displayed in the same way as a regular space, and the peculiarity is that if two words are separated by such a special space, then the browser will consider that this is one merged word, which cannot be separated. Due to this feature, the browser will not interfere with the display of several such spaces in a row, i.e. will not replace multiple spaces with one. This special sign is denoted by the following set of characters: "& nbsr;" (without quotes). In the source code of a document, a paragraph of text with words separated by such special characters can look like this:

This is a sample & nbsr; & nbsr; paragraph & nbsr; & nbsr; & nbsr; text.

Here the distance between the first and second word will be normal, between the second and third - doubled, and between the third and fourth - tripled.

Step 2

Much more commonly used is control of spacing between words using a style description language (CSS). In the CSS language, the corresponding definition may look like this: word-spacing: 15px; Here the size of the space between adjacent words is 15 pixels. You can add a style attribute to almost any tag. For example, a paragraph tag with this attribute, which sets the distance of 20 pixels between all the words in the paragraph, might look like this:

A paragraph of text with increased spacing between words

Step 3

Typically, style blocks are placed in the header of a document or in separate files. In such a block, you can set several values for the distances between words and pack them into different classes, and in the body of the document indicate links to the corresponding classes in the tags. For example, a description of a class named dblSpace might look like this:

.dblSpace {word-spacing: 20px}

And a paragraph tag with a link to this class in the body of the document will be, for example, like this:

A paragraph with wide word spacing

Recommended: