HTML CSS Reference/CSS Attributes and Javascript Style Properties/padding top

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

"padding-top" Example

    
<html>
<body>
<table>
    <tr>
        <td id="myTd">
            <img src="http://www.wbex.ru/style/logo.png" height="50" width="50" border="1">
        </td>
    </tr>
</table>
<button onclick="myTd.style.paddingTop=0">Set top padding to 0</button>
<button onclick="myTd.style.paddingTop=20">Set top padding to 20</button>
</body>
</html>



"padding-top" is applied to

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



"padding-top" Possible Values

Possible Values
length        A floating-point number followed by a unit designator
percentage    Percentage of the parent object height



"padding-top" Syntax and Note

Note:
Set the top padding size.
Syntax:
    
element { padding-top: value }
elementID.style.paddingTop = "value"
document.all.elementID.style.paddingTop = "value" // IE only