-
id and class attributes can be defined for any
element in the document body
-
id is a unique identifier associated with an element
- Used for interaction via a script, linking, object naming and styling
-
class is a space-separated list of class names
- class names are single case-sensitive words (can contain digits and dashes)
- Used to give more information about the markup
<body>
<p id="first">Ring me on <em class="phone home">01275 345873</em> or
<em id="primary" class="phone mobile">01345 345873</em>. Alternatively,
fax me on
<em id="secondary" class="fax work">01745 298524</em>. </p>
</body>