HTML CSS Reference/CSS Attributes and Javascript Style Properties/background color

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

"background-color" Example

   <source lang="html4strict">
   

<html> <head> </head> <body>

Text Text Text Text Text

           








Text Text Text Text

Text </body> </html>


     </source>
   
  


"background-color" is applied to

   <source lang="html4strict">

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

| |
<body> |

| |<button> |

| |
|

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

| | |defaults |

| |<dir>
| | |
| | | <fieldset> | | |<form> <hn> | | |<html> | | |<iframe> <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> <nobr> | | |
      <option> | | |

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

        "background-color" Possible Values

        <source lang="html4strict"> Possible Values color name hexadecimal number (#RRGGBB),or name transparent the default value

        </source>



        "background-color" Syntax and Note

        <source lang="html4strict"> Note: Sets the background color. Syntax:

        element { background-color: value } elementID.style.backgroundColor = "value" document.all.elementID.style.backgroundColor = "value" // IE only


        </source>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |