CSS Reference - Devdocs
CSS Reference - Devdocs
io/css/
CSS reference
Use this CSS reference to browse an alphabetical index of all of the standard CSS properties, pseudo-classes, pseudo-
elements, data types, functional notations and at-rules. You can also browse key CSS concepts and a list of selectors
organized by type. Also included is a brief DOM-CSS / CSSOM reference.
style-rule ::=
selectors-list {
properties-list
}
Where :
selectors-list ::=
selector[:pseudo-class] [::pseudo-element]
[, selectors-list]
properties-list ::=
[property : value] [; properties-list]
See the index of selectors, pseudo-classes, and pseudo-elements below. The syntax for each specified value depends on
the data type defined for each specified property.
strong {
color: red;
}
For a beginner-level introduction to the syntax of selectors, see our guide on CSS Selectors. Be aware that any syntax
error in a rule definition invalidates the entire rule. Invalid rules are ignored by the browser. Note that CSS rule
definitions are entirely (ASCII) text-based, whereas DOM-CSS / CSSOM (the rule management system) is object-based.
At-rule syntax
As the structure of at-rules varies widely, please see At-rule to find the syntax of the specific one you want.
Index
Note: The property names in this index do not include the JavaScript names where they differ from the CSS
1 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
standard names.
- B border-bottom-style
backface-visibility border-color
A
background border-end-end-radius
abs()
background-attachment border-end-start-radius
accent-color
background-blend-mode border-image
acos()
background-clip border-image-outset
:active
background-color border-image-repeat
additive-symbols (@counter-
background-image border-image-slice
style)
background-origin border-image-source
::after (:after)
background-position border-image-width
align-content
background-position-x border-inline
align-items
background-position-y border-inline-color
align-self
background-repeat border-inline-end
align-tracks
background-size border-inline-end-color
all
<basic-shape> border-inline-end-style
<an-plus-b>
::before (:before) border-inline-end-width
<angle>
:blank border-inline-start
<angle-percentage>
bleed (@page) border-inline-start-color
animation
<blend-mode> border-inline-start-style
animation-delay
block-overflow border-inline-start-width
animation-direction
block-size border-inline-style
animation-duration
blur() border-inline-width
animation-fill-mode
border border-left
animation-iteration-count
border-block border-left-color
animation-name
border-block-color border-left-style
animation-play-state
border-block-end border-left-width
animation-timeline
border-block-end-color border-radius
animation-timing-function
border-block-end-style border-right
@annotation
border-block-end-width border-right-color
annotation()
border-block-start border-right-style
:any-link
border-block-start-color border-right-width
appearance
border-block-start-style border-spacing
ascent-override (@font-face)
border-block-start-width border-start-end-radius
asin()
border-block-style border-start-start-radius
aspect-ratio
border-block-width border-style
ata2n()
border-bottom border-top
atan()
border-bottom-color border-top-color
atan2()
border-bottom-left-radius border-top-left-radius
attr()
border-bottom-right-radius border-top-right-radius
2 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
columns font-language-override
E font-optical-sizing
conic-gradient()
element()
contain font-size
ellipse()
content font-size-adjust
:empty
content-visibility font-stretch
empty-cells
contrast() font-stretch (@font-face)
:enabled
3 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
font-style H inset-inline-start
font-style (@font-face) frequency#Hz <integer>
font-synthesis hanging-punctuation :invalid
font-variant :has invert()
font-variant (@font-face) height :is
font-variant-alternates height (@viewport) isolation
font-variant-caps @historical-forms length#ic
font-variant-east-asian :host() length#in
font-variant-ligatures :host-context()
J
font-variant-numeric :hover
justify-content
font-variant-position hsl()
justify-items
font-variation-settings hsla()
justify-self
font-variation-settings (@font- hue-rotate()
justify-tracks
face) hwb()
font-weight hyphenate-character K
font-weight (@font-face) hyphens frequency#kHz
forced-color-adjust hypot() @keyframes
format()
<frequency> I L
<ident> lab()
<frequency-percentage>
<image> :lang
:fullscreen
image() :last-child
:future
image-orientation :last-of-type
G image-rendering @layer
angle#grad image-resolution layer()
gap image-set() layer() (@import)
<gradient> @import lch()
::grammar-error :in-range leader()
grayscale() :indeterminate :left
grid inherit left
grid-area inherits (@property) @left-bottom
grid-auto-columns initial <length>
grid-auto-flow initial-letter <length-percentage>
grid-auto-rows initial-letter-align letter-spacing
grid-column initial-value (@property) line-break
grid-column-end inline-size line-clamp
grid-column-start input-security line-gap-override (@font-face)
grid-row inset line-height
grid-row-end inset() line-height-step
grid-row-start inset-block linear-gradient()
grid-template inset-block-end :link
grid-template-areas inset-block-start list-style
grid-template-columns inset-inline list-style-image
grid-template-rows inset-inline-end list-style-position
4 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
5 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
6 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
Selectors
The following are the various selectors, which allow styles to be conditional based on various features of elements within
the DOM.
7 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
Basic selectors
Basic selectors are fundamental selectors; these are the most basic selectors that are frequently combined to create
other, more complex selectors.
Universal selector *
Type selector elementname
Class selector .classname
ID selector #idname
Attribute selector [attr=value]
Grouping selectors
Selector list A, B
Specifies that both A and B elements are selected. This is a grouping method to select several matching elements.
Combinators
Combinators are selectors that establish a relationship between two or more simple selectors, such as " A is a child of
B " or " A is adjacent to B ", creating a complex selector.
Specifies that the elements selected by both A and B have the same parent and that the element selected by B
immediately follows the element selected by A horizontally.
Specifies that the elements selected by both A and B share the same parent and that the element selected by A
comes before—but not necessarily immediately before—the element selected by B .
Specifies that the element selected by B is the direct child of the element selected by A .
Descendant combinator A B
Specifies that the element selected by B is a descendant of the element selected by A , but is not necessarily a
direct child.
Specifies that the element selected by B is located within the table column specified by A . Elements which span
multiple columns are considered to be a member of all of those columns.
Pseudo
Pseudo classes :
Pseudo elements ::
8 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
Concepts
CSS syntax
At-rules
Cascade
Comments
Descriptor
Inheritance
Shorthand properties
Specificity
Value definition syntax
CSS unit and value types
CSS functional notations
Values
Actual value
Computed value
Initial value
Resolved value
Specified value
Used value
Layout
DOM-CSS / CSSOM
9 of 10 03/01/2023 00:16
CSS documentation — DevDocs https://devdocs.io/css/
Document.styleSheets
styleSheets[i].cssRules
cssRules[i].selectorText
HTMLElement.style
Element.className
Element.classList
Important methods
CSSStyleSheet.insertRule()
CSSStyleSheet.deleteRule()
See also
External Links
Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.
10 of 10 03/01/2023 00:16