You’ll be seeing a lot of the
id attributes throughout this book. These are
universal attributes—they can be used by
any element in the HTML vocabulary that’s valid as
In addition to
id, there are four other attributes that are
dir specifies which direction
type should run.
style will be
described in Chapter 14.
Two attributes that can be assigned to all elements are
but only one
id value can be assigned to a given
class values are
separated by spaces, e.g.,
should contain only letters, numbers, hyphens, and underscores. These
values should begin only with letters and numbers. However, Internet
Explorer 6 parses and applies stylesheet values that are associated with
id values, and
property names that begin with underscores—an oversight that provides
stylists with a low-pass filtering technique.
A more important question is where to put
ids. As a rule,
classes should be assigned to those frequently
encountered elements that share both design purpose and presentation
peculiarities, but aren’t used predictably. On many sites,
classes are also assigned to the
body elements of pages that fall within a single section of the site’s architecture, such as the common “About” and “Contact” sections. ...