HTML CSS Reference/CSS Attributes and Javascript Style Properties/word spacing

Материал из Web эксперт
Перейти к: навигация, поиск

"word-spacing" Example

    
<html>
<body>
<div id="myD" 
     style="width:300px; background-color:beige;">
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
This is a sample paragraph.
</div>
<br>
<input type="button" 
       value="Set wordSpacing property to 10px" 
       onclick="myD.style.wordSpacing="10px"">
<input type="button" 
       value="Set wordSpacing property to 0.5cm" 
       onclick="myD.style.wordSpacing="0.5cm"">
<input type="button" 
       value="Set wordSpacing property to normal" 
       onclick="myD.style.wordSpacing="normal"">
</body>
</html>



"word-spacing" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <address>                     |
|                |<b>                             <big>                         |
|                |<blockquote>                    <body>                        |
|                |<button>                        <caption>                     |
|                |<center>                        <cite>                        |
|                |<code>                          <col>                         |
|                |<colgroup>                      currentStyle                  |
|                |<custom>                        <dd>                          |
|                |<dfn>                           <dir>                         |
|                |<div>                           <dl>                          |
|                |<dt>                            <em>                          |
|                |<fieldset>                      <form>                        |
|                |<hn>                            <html>                        |
|                |<i>                             <img>                         |
|                |<inputtype="button">            <input type="checkbox">       |
|                |<input type="file">             <input type="image">          |
|                |<input type="password">         <input type="radio">          |
|                |<input type="reset">            <inputtype="submit">          |
|                |<input type="text">             <isindex>                     |
|                |<kbd>                           <label>                       |
|                |<legend>                        <li>                          |
|                |<listing>                       <marquee>                     |
|                |<menu>                          <ol>                          |
|                |<p>                             <pre>                         |
|                |runtimeStyle                    <s>                           |
|                |<samp>                          <select>                      |
|                |<small>                         <span>                        |
|                |<strike>                        <strong>                      |
|                |style                           <sub>                         |
|                |<sup>                           <table>                       |
|                |<tbody>                         <td>                          |
|                |<textarea>                      <tfoot>                       |
|                |<th>                            <thead>                       |
|                |<tr>                            <tt>                          |
|                |<u>                             <ul>                          |
|                |<var>                           <xmp>                         |
+----------------+--------------------------------------------------------------+



"word-spacing" Possible Values

Possible Values
normal         default; no additional spaces
length         A floating-point number followed by a unit designator



"word-spacing" Syntax and Note

Note:
Controls the additional spaces between words.

Syntax:
    
element { word-spacing: value }
elementID.style.wordSpacing = "value"
document.all.elementID.style.wordSpacing = "value" // IE only