HTML and CSS Reference
In-Depth Information
Text spacing
There are two ways to control the spacing of text. This can be done by specifying the spacing
between each character in the text or by specifying the spacing between each word in the
text. The following CSS code demonstrates both examples. Figure 4-7 shows the output of
this code.
p {
letter-spacing: 8px;
}
p {
word-spacing: 8px;
}
FIGURE 4-7 Letter and word spacing using CSS3
Applying styles to text hyphenation
Applying styles to text hyphenation allows you to control how a sentence or word wraps or
breaks at the end of the line. The hyphen attribute can be specified to control this behavior.
The values available for the hyphen attribute are defined in Table 4-2.
TABLE 4-2 Values available for the hyphen attribute
Value
Description
Words will not break with a hyphen and the sentence will only break on whitespace.
none
Words will break based on a predefined algorithm.
Auto
Words will break based on specified hints in the words indicating an appropriate space for the
break. This is done using the ­ notation within the text.
Manual
The following code demonstrates using the none value, and the results are shown in
Figure 4-8.
div {
hyphens: none;
}
 
 
Search WWH ::




Custom Search