Web Design - Web Authoring / Intro to CSS: Class Selectors

Sections:  Introduction  |  Section 1  |  Section 2  |  Section 3
Section Two:  Part A  |  Part B  |  Part C  |  Part D  |  Part E  |  Part F  |  Part G  |  Part H  |  Part I

Comparing Type Selectors and Class Selectors

Ways that Class Selector Rules and Type Selector Rules are the Same:

  • They are both placed between the <style></style> tags.
  • The structure of a class selector rule is the same as the structure of a type selector rule in that the rule must have a selector and a declaration, with the declaration having a property and a value.

Ways that Class Selector Rules and Type Selector Rules are Different:

  • The selector themselves are formatted different. A type selector is simply an HTML tag minus the < and >. A class selector is not HTML specific but instead is created by the web designer.
  • A type selector rule whose selector is p, for the <p> tag, applies to all instances of the <p> tag in the HTML document. A class selector rule only applies to those tags that you specify.

Next Next

© 2008 KCDL. All rights reserved.