Cascading Style Sheets Quick Reference Guide

Style Sheets

xxx

Declarations

xxx

Selectors Level 3

Selectors

ID Selector element#id
Class Selector element.class
Type Selector element
Universal Selector *
Group of Selectors element1, element2, …

Attribute Selectors

Attribute is set element[attribute]
Attribute exactly equals value element[attribute = “value“]
Attribute contains value (exact word) element[attribute ~= “value“]
Attribute begins with value (exact word with dash) element[attribute |= “value“]
Attribute begins with value element[attribute ^= “value“]
Attribute ends with value element[attribute $= “value“]
Attribute contains substring value element[attribute *= “value“]

Combinators

Descendent selector element1 element2
Child selector element1 > element2
Adjacent sibling Selector element1 + element2
General sibling Selector element1 ~ element2

Pseudo Classes

Negation element:not(s)
Element is the document root element:root
nth child of element from first element:nth-child(n)
nth child of element from last element:nth-last-child(n)
nth type child of element from first element:nth-of-type(n)
nth type child of element from last element:nth-last-of-type(n)
First child of element element:first-child
Last child of element element:last-child
First type child of element element:first-of-type
Last type child of element element:last-of-type
Only child of element element:only-child
Only type child of element element:only-of-type
Element with no children element:empty
Unvisited link element:link
Visited link element:visited
Element is activated element:active
Cursor hover over element element:hover
Element has focus element:focus
Intra-document target element element:target
Element in language element:lang(lang)
Element is enabled element:enabled
Element is disabled element:disabled
Element is checked element:checked

Pseudo Elements

First line of element element::first-line
First letter of element element::first-letter
Generated content before element’s content element::before
Generated content after element’s content element::after

Background Properties

background
background-attachment
background-color
background-image
background-position
background-repeat

Border Properties

Border Width

border-width
border-top-width
border-right-width
border-bottom-width
border-left-width

Border Color

border-color
border-top-color
border-right-color
border-bottom-color
border-left-color

Border Style

border-style
border-top-style
border-right-style
border-bottom-style
border-left-style

Border Shorthand

border
border-top
border-right
border-bottom
border-left

Color

color
opacity

Font Properties

Generated Content

content
quotes
counter-reset
counter-increment

List Properties

list-style
list-style-image
list-style-position
list-style-type

Margin Properties

margin-top
margin-right
margin-bottom
margin-left
margin

Multi-column Layout Properties

break-before
break-after
break-inside
columns
column-count
column-fill
column-gap
column-rule
column-rule-color
column-rule-width
column-rule-style
column-span
column-width

Padding Properties

padding-top
padding-right
padding-bottom
padding-left
padding

Paged Media Properties

Positioning Properties

display
position
top
right
bottom
left
float
clear
z-index
overflow
clip

Table Properties

Text Properties

User Interface Properties

More Properties

Webterranean Articles