CSS3 Selectors provide new, more powerful ways to select nodes using CSS.
A Selector represents a structure.
Every CSS rule devided into two parts :
a) Selector : determining which content to effect
b) Declaration Block : determining which of the element will be modified.properties
A simple selector can contain many types:
Type Selectors : it will select all elements of a certain type . ex: p { Color : #36c; }
Universal Selector : Rather than selecting elements of a specific type, the universal selector simply matches the name of any element type. eg: * { Color : #36c; }Descendant Selectors: Descendant selectors are used to select elements that are descendants of another element in the document tree. eg: em { text-transform: uppercase;}
Class Selector: Selecting elements on the basis of their class names. eg:.warning
Id Selector : ID selector matches an element that has a specific id attribute value . e.g.: #menu
Child Selectors: Child selector applies to the elements that are children of another element. e.g. : ul em { text-transform: uppercase;}
Attribute Selectors: Attribute selector applies to elements with specific attributes. ex: [type=”submit”]
The most useful CSS 3 selectors are the attribute selectors [a^=v], [a$=v] and [a*=v], and the nth-child selector.The nth-child selector allows highlighting of every other row in a table or of every other paragraph in a long piece of text. The selector is supported partially by the current version of Firefox.