Today to introduce the common selector syntax in CSS3, the syntax is generally divided into three kinds, basic selector syntax, hierarchy selector syntax and dynamic pseudo-class selector syntax. The following will give you a detailed explanation.
1, basic selector syntax
(1) * Wildcard Selector Select a document so HTML elements
(2) E element Selector Selects HTML elements of the specified type
#id The ID selector Select any type element that specifies the id attribute value is "id"
The. Class selector selects any number of elements of any type that specify a class attribute value of "class"
Selector1,selectorn Group Selector Merges the set of elements matching each selector
2, Hierarchy selector syntax
(1) E F descendant selector (contains selector) selects the matched F element, and the matched F element is contained within the matched e element
(2) The E>F sub-selector selects the matched F element, and the matched F element matches the child element of the E element
(3) E+f the adjacent sibling selector selects the matched F element, and the matched F element is positioned immediately after the matched e element
(4) The E~F Universal selector selects the matched F element, and all matching f elements after the matched e element
3, dynamic Pseudo-class selector syntax
(1) The E:link link pseudo-class selector selects the matched e element, and the matching element is defined and the hyperlink has not been accessed. Often used on link strokes.
(2) The e:visited link pseudo-class selector selects the matching e element, and the matching element is defined with a hyperlink and has been accessed. Often used on link strokes.
(3) The e:active user behavior selector selects the matching e element, and the matching element is activated. Often used on link strokes and buttons
(4) The E:hover user behavior selector selects the matched e element, and the user mouse rests on the element E. IE6 and the following browsers only support A:hover
(5) E:focus the user behavior selector selects the matched e element, and the matching element gets the focus
I believe you have read the above introduction you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Related reading:
Making method of making fireworks particle special effects with H5
Make Div width Adaptive teaching
Development experience of using H tags in web pages