CSS Selectors ============= Selectors are pointers or members of collections of pointers of objects of html document. Selectors are usabel to define styles of many objects of html document. Collections of of pointers of objects of html document are an old thing of development of HTML DOM. So CSS use HTML DOM. CSS is an overhead of old things. ... Who need that ? Selector Example Example description CSS version ------------------------------------------------------------------------------------------------------------------------------------------------------------------- .class .intro Selects all elements with class="intro" 1 #id #firstname Selects the element with id="firstname" 1 * * Selects all elements 2 element p Selects all

elements 1 element,element div,p Selects all

elements and all

elements 1 element element div p Selects all

elements inside

elements 1 element>element div>p Selects all

elements where the parent is a

element 2 element+element div+p Selects all

elements that are placed immediately after

elements 2 [attribute] [target] Selects all elements with a target attribute 2 [attribute=value] [target=_blank] Selects all elements with target="_blank" 2 [attribute~=value] [title~=flower] Selects all elements with a title attribute containing the word "flower" 2 [attribute|=value] [lang|=en] Selects all elements with a lang attribute value starting with "en" 2 :link a:link Selects all unvisited links 1 :visited a:visited Selects all visited links 1 :active a:active Selects the active link 1 :hover a:hover Selects links on mouse over 1 :focus input:focus Selects the input element which has focus 2 :first-letter p:first-letter Selects the first letter of every

element 1 :first-line p:first-line Selects the first line of every

element 1 :first-child p:first-child Selects every

element that is the first child of its parent 2 :before p:before Insert content before the content of every

element 2 :after p:after Insert content after every

element 2 :lang(language) p:lang(it) Selects every

element with a lang attribute equal to "it" (Italian) 2 element1~element2 p~ul Selects every