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

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

"word-wrap" Example

    
<html>
<body>
<div style="width:80pt; background-color:beige; word-wrap:breakword;">
     Text Text Text Text Text Text Text Text Text TextTextTextTextTextTextTextText 
</div>
</body>
</html>



"word-wrap" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <applet>                      |
|                |<b>                             <bdo>                         |
|                |<big>                           <blockquote>                  |
|                |<body>                          <button>                      |
|                |<center>                        <cite>                        |
|                |<code>                          currentStyle                  |
|                |<custom>                        <dd>                          |
|                |<del>                           <dfn>                         |
|                |<dir>                           <div>                         |
|                |<dl>                            <dt>                          |
|                |<em>                            <embed>                       |
|                |<fieldset>                      <font>                        |
|                |<form>                          <hn>                          |
|                |<hr>                            <html>                        |
|                |<i>                             <img>                         |
|                |<input>                         <input type="button">         |
|                |<input type="checkbox">         <inputtype="file">            |
|                |<input type="hidden">           <input type="image">          |
|                |<input type="password">         <input type="radio">          |
|                |<input type="reset">            <input type="submit">         |
|                |<inputtype="text">              <ins>                         |
|                |<isindex>                       <kbd>                         |
|                |<label>                         <legend>                      |
|                |<li>                            <listing>                     |
|                |<menu>                          <nobr>                        |
|                |<object>                        <ol>                          |
|                |<option>                        <p>                           |
|                |<pre>                           <q>                           |
|                |<rt>                            <ruby>                        |
|                |runtimeStyle                    <s>                           |
|                |<samp>                          <select>                      |
|                |<small>                         <span>                        |
|                |<strike>                        <strong>                      |
|                |style                           <sub>                         |
|                |<sup>                           <td>                          |
|                |<textarea>                      <th>                          |
|                |<tt>                            <u>                           |
|                |<ul>                            <var>                         |
|                |<xmp>                                                         |
+----------------+--------------------------------------------------------------+



"word-wrap" Possible Values

Possible Values
normal          default; content does not break words

break-word      Content wraps to the next line



"word-wrap" Syntax and Note

Note:
How to wrap word.
Only applied to absolutely positioned elements or elements with a 
specified height or width.


Syntax:
    
element { word-wrap: value }
elementID.style.wordWrap = "value"
document.all.elementID.style.wordWrap = "value"