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
|