Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Last active March 18, 2016 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a1exlism/7255366a4c864f549560 to your computer and use it in GitHub Desktop.
Save a1exlism/7255366a4c864f549560 to your computer and use it in GitHub Desktop.
1. 子选择器
X Y 所有后代
X>Y 只选择儿子
2.兄弟
X~Y Y是X的之后的所有兄弟
X+Y Y是X之后的直接兄弟
3.属性
X[href="foo"]
4.包含属性*
a[href*="a1ex"]{
color:#000;
}
所有包含a1ex字段的链接全是黑色
5.头尾^= $=
6. X:before X:after
7. 反选
div:not(#container){
不选择id为container的div
}
8.按照顺序选择
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment