HTML CSS Reference/HTML Attributes Reference/class

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

"class" Example

   <source lang="html4strict">
   

<html> <head> <style>.myclass { font-family:times new roman;

                 font-weight:bold; 
                 font-size:16px;
                 color:red; } 

</style> </head> <body>

style in myclass

</body> </html>


     </source>
   
  


class is applied to

   <source lang="html4strict">

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

| |
<body> |

| |
<button> |

| |
|

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

| | | |

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

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

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

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

        "class" Syntax and Note

        <source lang="html4strict"> Note:

        The styles can be define in a custom style sheet or in a <style> element tag.

        Syntax:

        <HTML> <head><Title>Example For class</Title></head> <BODY> <element class="className"> . . . </element> <element class="class1 class2 class3 . . ."> . . . </element> </BODY> </HTML>


        </source>

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