HTML CSS examples for CSS Property:word-spacing
The word-spacing CSS property sets the spacing between the words in the text content.
The following table summarizes the word-spacing Property.
Item | Value |
---|---|
Default value: | normal |
Applies to: | All elements. It also applies to ::first-line. |
Inherited: | yes |
Animatable: | Yes. |
The syntax of the property is as follows:
word-spacing: length | normal | initial | inherit
The following table describes the values of this property.
Value | Description |
---|---|
length | Set the spacing as a length value in px, pt, cm, em, etc. Negative length values are allowed. |
normal | Set the normal word spacing. This is default value. |
initial | Sets this property to its default value. |
inherit | take the value of its parent element word-spacing property. |
The example below shows the word-spacing property.
<!DOCTYPE html> <html lang="en"> <head> <title>Example of CSS word-spacing property</title> <style type="text/css"> p.normal {<!-- w w w .j a va2 s . co m--> word-spacing: normal; } p.spacing { word-spacing: 50px; } </style> </head> <body> <p class="normal">This is a normal paragraph (normal).</p> <p class="spacing">This is a paragraph with word spacing (50px).</p> </body> </html>