Class Selectors.
Written by VR Sunday, 06 March 2011 14:27
A class selectors is an identifier you can to assign a style to a subset of elements in a document.To apply a class selector,you first invent an identifier for the class name.To allow for the potential scripting of class names,it is wise to adhere to the rules of JavaScript identifiers when devising class names.A JavaScript identifier is a one-word name that can include numerals,letters and limited punctuation.Also the first character of an identifier cannot be a numbered.The CSS2 guidelines for selector identifiers are less stringent:you can embed hyphens.Unicode characters above 160,and escaped characters in an identifier,but the name must not began with a numeral or hyphen.If you are now or may eventually script class selectors follow the JavaScript rules instead of the more liberal CSS2 rules.The class identifier goes in both the style sheet rule and the HTML tag for the element that is to obey the rule.While the identifier name is the same in both cases,the syntax for specifying it is quite different in each place.
| < Prev | Next > |
|---|