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

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

"width" Example

   <source lang="html4strict">
   

<html> <body> <img id="myImg"

    src="http://www.wbex.ru/style/logo.png" 
    width="132">


<input type="button" value="Shrink image" onclick="myImg.style.width="20""> <input type="button" value="Restore image" onclick="myImg.style.width="132""> </body> </html>


     </source>
   
  


"width" is applied to

   <source lang="html4strict">

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

| |
|

| |<button> |

| |
|

| | currentStyle | | |<custom>

| | | |

| |<dir>
| | |
| | | <fieldset> | | | <form> | | |<hn>
|

| | | | | <label> |

| |<legend>
  • | | |<listing> <menu> | | |<nobr>
      | | |<option>

      | | |

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

        "width" Possible Values

        <source lang="html4strict"> Possible Values auto default; regular HTML position length A floating-point number followed by a unit designator percentage Percent width of the parent object


        </source>



        "width" Syntax and Note

        <source lang="html4strict"> Note: Sets the element width. Syntax:

        element { width: value } elementID.style.width = "value" document.all.elementID.style.width = "value" // IE only


        </source>