SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 455 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


Defining new class and ID selectors
for extended design control
Redefining existing HTML tags is a step in the right direction toward consistent design, but the real power
of CSS comes into play when you define custom selectors. One type of custom selector is called a class; class
selector names always begin with a period. Here??™s a simple example: To style all copyright notices at the bottom
of all pages of a Web site to display in 8-point Helvetica all caps, you could define a tag like this:
.cnote {
font-family:Helvetica, sans-serif;
font-size:8pt;
font-transform:uppercase
}
If you define this style in an external style sheet and apply it to all 999 pages of your Web site, you have to
alter only one line of code (instead of all 999 pages) when the edict comes down from management to make
all the copyright notices a touch larger. After a new class has been defined, you can apply it to any range of
text, from one word to an entire page.
Classes are typically applied to more than one element on a page. You could, for example, have more than
one paragraph styled as a copyright notice in various parts of the page. A custom tag intended to be applied
to a single element, such as a
tag that contains the footer content, is called an ID selector.


Pages:
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467