Specifying the Space Between Words

Description

word-spacing sets the space between words.

Its value can be normal or CSS length value.

Example


<!DOCTYPE HTML>
<html>
<head>
<style>
#mytext {<!--from w  ww .j  a va2  s.c om-->
    word-spacing:  10px;
}
p.normal {
    word-spacing: normal;
}

p.wide {
    word-spacing: 3em;
}

p.narrow {
    word-spacing: -.5ex;
}
</style>
</head>
<body>
    <p id="mytext">
        This is a test.This is a test.This is a test.This is a test.
    </p>
    <p class="normal">This paragraph has normal word-spacing.</p>
    <p class="wide">This paragraph uses a 3em word-spacing.</p>
    <p class="narrow">This paragraph uses a -.5ex word-spacing.</p>

</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table