CSS Study Notes— Selectors for Class/Div/Attribute
2014-08-12 15:21
525 查看
— Combinators
Also refer to: http://www.w3schools.com/css/css_combinators.asp
1. Descendant Selector div p:matches all elementthat aredescendantsof
aspecified element
2. Child Selector div> p:selects all elements that are theimmediate
children of a specified element
3. Adjacent SiblingSelector div+ p:selects all elementsthat are theadjacentsiblingsofa
specified element
4. General Sibling Selector div~ p:selects all elements that aresiblingsof
a specified element
— Pseudo Classes/Elements
Also refer to: http://www.w3schools.com/css/css_pseudo_classes.asp
— Attribute Selectors
Also refer to : http://www.w3schools.com/css/css_attribute_selectors.asp
1. The[attribute] selector is used to select elements with the specified attribute.
2. The [attribute=value] selector is used to select elementswith the specified attribute and value.
3. The [attribute~=value] selectoris used to selectelements with an attribute value containing
aspecified word.
4. The [attribute|=value] selector is used to select elements withthe specified attribute starting
withthe specified value.
5. The [attribute^=value] selectoris used to select elementswhose attribute value begins with a specified value.
6. The [attribute$=value] selector is used to select elementswhose attribute value endswith a specified value.
7. The [attribute*=value] selector is usedto select elementswhose attribute value contains a specified value.
Borrowing from CSS 1–3, and then adding its own, jQuery offers a powerful set of tools for matching
a set of elements in a document, if you would like to refer more, please also click here: http://api.jquery.com/category/selectors/
Also refer to: http://www.w3schools.com/css/css_combinators.asp
1. Descendant Selector div p:matches all elementthat aredescendantsof
aspecified element
2. Child Selector div> p:selects all elements that are theimmediate
children of a specified element
3. Adjacent SiblingSelector div+ p:selects all elementsthat are theadjacentsiblingsofa
specified element
4. General Sibling Selector div~ p:selects all elements that aresiblingsof
a specified element
— Pseudo Classes/Elements
Also refer to: http://www.w3schools.com/css/css_pseudo_classes.asp
Selector | Example | Example description |
:link | a:link | Selects all unvisited links |
:visited | a:visited | Selects all visited links |
:active | a:active | Selects the active link |
:hover | a:hover | Selects links on mouse over |
:focus | input:focus | Selects the input element which has focus |
::first-letter | p::first-letter | Selects the first letter of every <p> element |
::first-line | p::first-line | Selects the first line of every <p> element |
:first-child | p:first-child | Selects every <p> elements that is the first child of its parent |
::before | p::before | Insert content before every <p> element |
::after | p::after | Insert content after every <p> element |
:lang(language) | p:lang(it) | Selects every <p> element with a lang attribute value starting with "it" |
Also refer to : http://www.w3schools.com/css/css_attribute_selectors.asp
1. The[attribute] selector is used to select elements with the specified attribute.
2. The [attribute=value] selector is used to select elementswith the specified attribute and value.
3. The [attribute~=value] selectoris used to selectelements with an attribute value containing
aspecified word.
4. The [attribute|=value] selector is used to select elements withthe specified attribute starting
withthe specified value.
5. The [attribute^=value] selectoris used to select elementswhose attribute value begins with a specified value.
6. The [attribute$=value] selector is used to select elementswhose attribute value endswith a specified value.
7. The [attribute*=value] selector is usedto select elementswhose attribute value contains a specified value.
Borrowing from CSS 1–3, and then adding its own, jQuery offers a powerful set of tools for matching
a set of elements in a document, if you would like to refer more, please also click here: http://api.jquery.com/category/selectors/
相关文章推荐
- 关于Tomcat: The value for the useBean class attribute is invalid 问题的另类解释
- The value for the useBean class attribute XXX is invalid
- The value for the useBean class attribute is invalid 问题
- DIV+CSS学习--关于ID和CLASS
- DIV+CSS学习--关于ID和CLASS
- 详解 Tomcat: The value for the useBean class attribute is invalid 问题
- 详解 Tomcat: The value for the useBean class attribute is invalid 问题
- div+css - CSS标准 - 5.8.3 Class selectors - Class选择器
- div+css中id和class的区别运用详解
- DIV+CSS布局入门教程(六) -- 关于ID和CLASS
- DIV+CSS排版中制作细线条的三种方法--FOR IE
- Tomcat 常见 "The value for the useBean class attribute is invalid" 错误
- DIV+CSS中ID和CLASS
- 关于Tomcat: The value for the useBean class attribute is invalid 错误提示的解决方案
- study notes for EJB 3 in action (II)
- Tomcat 中 "The value for the useBean class attribute is invalid" 错误的排除
- div+css中Class与ID的区别
- "The value for the useBean class attribute is invalid" 错误。
- 详解 Tomcat: The value for the useBean class attribute is invalid 问题
- Attribute class invalid for tag text according to TLD这个struts错误怎么解决啊