JavaScript Reference/Javascript Objects/style

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

"style" CSS Attributes and JavaScript Style Properties

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | CSS |accelerator background | | Attributes |background-attachment background-color | | and |background-image background-position | | JavaScript |background-position-x background-position-y | | Style |background-repeat behavior | | Properties |border border-bottom | | |border-bottom-color border-bottom-style | | |border-bottom-width border-color | | |border-left border-left-color | | |border-left-style border-left-width | | |border-right border-right-color | | |border-right-style border-right-width | | |border-style border-top | | |border-top-color border-top-style | | |border-top-width border-width | | |color cursor | | |direction display | | |filter font | | |font-family font-size | | |font-style font-variant | | |font-weight hasLayout(*) | | |layout-grid layout-grid-char | | |layout-grid-line layout-grid-mode | | |layout-grid-type letter-spacing | | |line-break line-height | | |margin margin-bottom | | |margin-left margin-right | | |margin-top overflow | | |overflow-x overflow-y | | |padding padding-bottom | | |padding-left padding-right | | |padding-top page-break-after | | |page-break-before pixelBottom(*) | | |pixelHeight(*) pixelLeft(*) | | |pixelRight(*) pixelTop(*) | | |pixelWidth(*) posBottom(*) | | |posHeight(*) posLeft(*) | | |posRight(*) posTop(*) | | |posWidth(*) scrollbar-3dlight-color | | |scrollbar-arrow-color scrollbar-base-color | | |scrollbar-darkshadow-color scrollbar-face-color | | |scrollbar-highlight-color scrollbar-shadow-color | | |scrollbar-track-color text-align | | |text-align-last text-autospace | | |text-decoration text-indent | | |text-justify text-kashida-space | | |text-overflow text-transform | | |text-underline-position textDecorationBlink(*) | | |textDecorationLineThrough(*) textDecorationNone(*) | | |textDecorationOverline(*) textDecorationUnderline(*) | | |unicode-bidi visibility | | |white-space word-break | | |word-spacing word-wrap | | |zoom | +----------------+--------------------------------------------------------------+

     </source>
   
  


"style" Example

   <source lang="javascript">
   

<html> <body>

<button onclick="myDiv.style.backgroundColor = "blue";">Change color</button> </body> </html>


     </source>
   
  


"style" is applied to

   <source lang="javascript">

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

| |
<body> |

| |
<button> |

| |
|

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

| | |defaults | | | <dir> |

| |
|

| |

| | |<embed> <fieldset> | | | <form> | | |<frame> <frameset> |

| |<hn>
|

| |<html> | | |<iframe> <img> | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <input type="hidden"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | | | | |<label> <legend> |

| |
  • <listing> | | |<marquee> <menu> | | |<nobr> <object> | | |
      <option> | | |

                               |
      |                |                             rule                          |
      |                |                                                     |
      |                |<select>                                               |
      |                |                                                |
      |                |                                                 |
      |                |                                                  |
      |                |<tbody>                                                   |
      |                |                             
        | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "style" JavaScript Methods

        <source lang="javascript"> +----------------+--------------------------------------------------------------+ | JavaScript |getAttribute getAttributeNode | | Methods |getExpression normalize | | |removeAttribute removeAttributeNode | | |removeExpression setAttribute | | |setAttributeNode setExpression | +----------------+--------------------------------------------------------------+

        </source>



        "style" JavaScript Properties

        <source lang="javascript"> +----------------+--------------------------------------------------------------+ | JavaScript |cssText onOffBehavior | +----------------+--------------------------------------------------------------+

        </source>



        "style" Microsoft Filters

        <source lang="javascript"> +----------------+--------------------------------------------------------------+ | Microsoft |Alpha Barn | | Filters |BasicImage BlendTrans | | |Blinds Blur | | |CheckerBoard Chroma | | |Compositor DropShadow | | |Emboss Engrave | | |Fade FlipH | | |FlipV Glow | | |GradientWipe Gray | | |ICMFilter Inset | | |Invert Iris | | |Light MaskFilter | | |Matrix MotionBlur | | |Pixelate RadialWipe | | |RandomBars RandomDissolve | | |RevealTrans Shadow | | |Slide Spiral | | |Stretch Strips | | |Wave Wheel | | |Xray Zigzag | +----------------+--------------------------------------------------------------+

        </source>



        "style" Syntax and Note

        <source lang="javascript"> Note: This object represents the current style sheet settings for a given element.

        Syntax:

        document.all.elementID.style.memberName


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |