您的位置:首页 > Web前端 > CSS

A list of supported CSS selectors when invoking g(..)

2009-01-22 14:08 211 查看

A list of supported CSS selectors when invoking g(..)

At it's most basic, Gimme is a utility for retrieving lots of elements
quickly and then acting upon all of them at once. This is done through
a call to the g(..) function.

The g(..) function takes one
parameter: a string formatted like a CSS selector which indicates which
elements you want Gimme to retrieve for you.

The following is a list of currently support CSS selectors (more to come);

*(univeral selector) matches any element

E matches ny E element (e.g. an element of type E)

E F matches any F element that is a descendant of an E element

E > F matches any F element that is a direct child of an E element

E + F matches any F element immediately preceded by an E element

E ~ F matches any F element that is a following sibling of an E element

E[foo] matches any E element that has the attribute foo (regardless of its value)

E[foo="warning"] matches any E element whose foo attribute is exactly "warning"

E[foo^="war"] matches any E element whose foo attribute starts with "war"

E[foo$="ing"] matches any E element whose foo attribute ends with "ing"

E[lang|="en"] matches any E element whose lang attribute has a hyphen-separated list of values beginning (from the left) with "en"

E.warning matches any E element that has the class "warning" applied to it

E.warning.severe matches any E element that has both classes "warning" and "severe" applied to it

#id matches any element whose id attribute is exactly id

E#id matches any E element whose id attribute is exactly id

E:first-child matches an E element, first child of its parent

E:last-child matches an E element, last child of its parent

E:nth-child(n) an E element, the n-th child of its parent

TODO:

E[attr|val]

E:enabled

E:disabled

E:checked

E:target

E:not

E:root

E:empty
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐