tag {property: value;}
=> Selects that tag#idName {property: value;}
=> Selects that id.className {property: value;}
=> Selects that class* {property: value;}
=> Selects everything (except ::before & ::after ...)* {property: value;}
.className tag {property: value;}
=> Selects the children tag of the given class, Similarly nested selectors can be used for other cases.className > tag {property: value;}
=> Selects all the direct children tag of the given class.className tag + tag {property: value;}
=> Selects the children tags of className which has a adjacent tag before it.className tag ~ tag {property: value;}
=> Selects the children tags of className which has a tag before it[attributeName] {property: value;}
=> Selects the tag having this attribute[attributeName="val"] {property: value;}
=> Selects the tag having this attribute with given exact value[attributeName|="val"] {property: value;}
=> Selects the tag having this attribute with given value as starting separated by "-" from rest of the value[attributeName^="val"] {property: value;}
=> Selects the tag having this attribute with given value as starting[attributeName*="val"] {property: value;}
=> Selects the tag having this attribute with actual value containing the given value[attributeName$="val"] {property: value;}
=> Selects the tag having this attribute with given value at the end.idName:hover {property: value;}
.idName:active {property: value;}
.idName:empty {property: value;}
=> Matches every element that has no children (including text nodes).idName:visited {property: value;}
:target {property: value;}
=> To style the current active target element:not(tagName/selector) {property: value;}
=> Matches every element that is NOT the specified element/selector:where(selectors) {property: value;}
=> To remove specificity from a complex selector.idName::only-child {property: value;}
=> Matches every element that is the only child of its parent.idName::only-of-type {property: value;}
.idName::first-line {property: value;}
.idName::first-child {property: value;}
.idName::nth-child(n) {property: value;}
.idName::nth-child(odd) {property: value;}
.idName::nth-child(n1*n2+n3) {property: value;}
.idName::nth-of-type(n) {property: value;}
.idName::after {property: value;}
.idName::before {
content: "";
<!-- Pulls data from the attribute from HTML -->
content: attr(attributeName);
}
@media () and () {
/* Code */
}
@media only screen and () {
/* Code */
}
@media not all and () {}
@media (prefers-color-scheme: dark) {
/* Code */
}
@media (hover: hover) {
/* Code */
}
@media (hover: none) {
/* Code */
}
@supports (property: value) {
/* Code */
}
@supports not (property: value) {
/* Code */
}
@supports (property: value) or (property: value) {
/* Code */
}
@supports (property: value) and (property: value) {
/* Code */
}