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

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

"color" Example

   <source lang="html4strict">
   

<html> <head> <style> .style1 {

  font-family:verdana; 
  color:purple 

} </style> </head> <body>

A color text.

</body> </html>


     </source>
   
  


"color" is applied to

   <source lang="html4strict">

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

| |
|

| |<body> <button> |

| |
|

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

defaults | | | <dir> |

| |
|

| |

| | |<fieldset> <form> | | |<hn> <html> | | | <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>

        "color" Syntax and Note

        <source lang="html4strict"> Note: Defines the text color.

        Syntax:

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


        </source>

      <textarea> | | |<tfoot> | | |<thead>