https://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048 Originally by Jeffrey Way, 9 Jun 2011
.error { color: red;}Class selectorli a { text-decoration: none;}Descendant selector.a { color: red;}Adjacent selector only if the element is Y immediately preceded by X.a[title] { color: green;}X[href="foo"] /* href == foo */
X[href*="foo"] /* foo somewhere in href */
X[href^="foo"] /* href begins with foo */
X[href$="foo"] /* href ends with foo */
a[data-filetype="image"] { color: red;}a[data-info="external"] { color: red;}a[data-info="image"] { border: 1px solid black;}<a href="path/to/image.jpg" data-info="external image">pseudo-classx::first-linex::first-letter2n for every two items.|
X:nth-of-type(n)
|
|
X:nth-last-of-type(n)
|
|
X:first-child
|
|
X:last-child
|
|
X:only-child
|
|
X:only-of-type / no siblings within parent container /
|
|
X:first-of-type
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.