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

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

"padding" Example

   <source lang="html4strict">
   

<html> <body>

The image below has an all-around padding of 30px.

         <img src="http://www.wbex.ru/style/logo.png" 
              height="50" 
              width="50" 
              border="1">

</body> </html>


     </source>
   
  


"padding" is applied to

   <source lang="html4strict">

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

| |
|

| |<body> <button> |

| |
|

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

defaults | | | |

| |<dir>
| | |
| | | <embed> | | |<fieldset> | | |<form> <frame> | | |<hn>
|

| | <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"> | | | <label> |

| |<legend>
  • | | |<listing> <marquee> | | |<menu> nextID | | |<nobr> <object> | | |

      | | |

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

        "padding" Syntax and Note

        <source lang="html4strict"> Note: Set four different padding style: padding-top, padding-right, padding-bottom, and padding-left.

        Syntax:

        element { padding: values } elementID.style.padding = "values" document.all.elementID.style.padding = "values" // IE only


        </source>