"CORE" STANDARD ATTRIBUTES | |
---|---|
These can modify or identify tags used in the body element. But there are other tag-specific attributes, too. | |
class="?" | The value will be a name pre-defined in a style sheet. |
id="?" | This allows you to "target" the identified element to create internal links,
and to program stuff which will apply only to the identified element.
The number sign (#) references the id:
id="foo" is referenced as: #foo.
The value of each tag identifier must be unique, i.e., an
id attribute may not be repeated in any other tag. And it can't start
with a digit or a hyphen.
Although id replaces the deprecated name attribute, the W3C recommends using identical id and name attributes for "maximum forward and backward compatibility" with browsers [but name won't validate with a "strict" DOCTYPE]: EXAMPLE:
<h3 id="foo" name="foo">A Heading Called "foo"</h3>
|
style="?" | Use to modify style features inline, i.e., at
the point where the change takes effect.
The value ("?"), or style "declaration," takes the form:
Multiple properties are separated by semicolons. EXAMPLE:
<p style="text-indent: 5%; color: silver;
font: bold smaller verdana">This paragraph
is indented 5% of its width, and the silver, bold-faced text is in a
font named "verdana." It's smaller, too.
These features last until the paragraph is closed, unless changed
by another <span style="color: black; font: italic large serif">style
attribute</span> along the way.</p>
displays as:
This paragraph is indented 5% of its width, and the silver, bold-faced text is in a font named "verdana." It's smaller, too. These features last until the paragraph is closed, unless changed by another style attribute along the way. [Note: There is an optional style tag (as opposed to this style attribute) in the head element that pre-defines display features. External style sheets provide another (better) way to pre-define stylistic features, too.] |
title="?" | Use this to create pop-up text boxes, or "tool tips." |