HTML CSS Reference/CSS Attributes and Javascript Style Properties/line height

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

"line-height" Example

   <source lang="html4strict">
   

<html> <body>

This is the first line if a sample text.
And this is its second line.

<input type="button"

      value="Set lineHeight to 30px" 
      onclick="myP.style.lineHeight="30px"">
      

<input type="button"

      value="Restore line height to normal" 
      onclick="myP.style.lineHeight="normal"">

<input type="button"

      value="Restore line height to 50%" 
      onclick="myP.style.lineHeight="50%"">

</body> </html>


     </source>
   
  


"line-height" is applied to

   <source lang="html4strict">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <address> | | | |

| |
<body> |

| |<button> |

| |
|

| | <col> | | |<colgroup> currentStyle | | |<custom>

| | |defaults |

| |<dir>
| | |
| | | <fieldset> | | |<form> <hn> | | |<html> | | |<img> <input type="button"> | | |<input type="checkbox"> <input type="file"> | | |<inputtype="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | |<isindex> | | |<label> <legend> | | |
  • <listing> | | |<marquee> <menu> | | |

      | | |

                                 runtimeStyle                  |
      |                |                                                     |
      |                |<select>                                               |
      |                |                                                |
      |                |                        style                         |
      |                |                                                    |
      |                |                         <tbody>                       |
      |                |                          |
      |                |                                                       |
      |                |
        | | |<xmp> | +----------------+--------------------------------------------------------------+ </source>

        "line-height" Possible Values

        <source lang="html4strict"> Possible Values normal The default height A floating-point number followed by a unit designator percentage Percentage of the height of the parent object


        </source>



        "line-height" Syntax and Note

        <source lang="html4strict"> Note: Controls the line height. Syntax:

        element { line-height: value } elementID.style.lineHeight = "value" document.all.elementID.style.lineHeight = "value" // IE only


        </source>

      <textarea> | | |<tfoot> | | |<thead>