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.
Basic rule syntax
>Style rule syntax
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.
Style rule examples
strong {
color: red;
}
div.menu-bar li:hover > ul {
display: block;
}
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 (Unicode) 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: This index does not include SVG-exclusive presentation attributes, which can be used as CSS properties on SVG elements.
Note: The property names in this index do not include the JavaScript names which do differ from the CSS standard names.
-
-webkit-text-fill-colorCSS property-webkit-text-strokeCSS property-webkit-text-stroke-colorCSS property-webkit-text-stroke-widthCSS property
A
- Attribute selectors
abs()CSS function<absolute-size>CSS typeaccent-colorCSS propertyacos()CSS function:activeCSS pseudo-class:active-view-transitionCSS pseudo-class:active-view-transition-type()CSS pseudo-classadditive-symbolsCSS at-rule descriptor (@counter-style)::afterCSS pseudo-elementalign-contentCSS propertyalign-itemsCSS propertyalign-selfCSS propertyalignment-baselineCSS propertyallCSS property<alpha-value>CSS typeanchor()CSS functionanchor-nameCSS propertyanchor-scopeCSS propertyanchor-size()CSS function<angle-percentage>CSS type<angle>CSS typeanimationCSS propertyanimation-compositionCSS propertyanimation-delayCSS propertyanimation-directionCSS propertyanimation-durationCSS propertyanimation-fill-modeCSS propertyanimation-iteration-countCSS propertyanimation-nameCSS propertyanimation-play-stateCSS propertyanimation-rangeCSS propertyanimation-range-endCSS propertyanimation-range-startCSS propertyanimation-timelineCSS propertyanimation-timing-functionCSS property:any-linkCSS pseudo-classappearanceCSS propertyascent-overrideCSS at-rule descriptor (@font-face)asin()CSS functionaspect-ratioCSS propertyatan()CSS functionatan2()CSS functionattr()CSS function:autofillCSS pseudo-class<axis>CSS type
B
::backdropCSS pseudo-elementbackdrop-filterCSS propertybackface-visibilityCSS propertybackgroundCSS propertybackground-attachmentCSS propertybackground-blend-modeCSS propertybackground-clipCSS propertybackground-colorCSS propertybackground-imageCSS propertybackground-originCSS propertybackground-positionCSS propertybackground-position-xCSS propertybackground-position-yCSS propertybackground-repeatCSS propertybackground-repeat-xCSS propertybackground-repeat-yCSS propertybackground-sizeCSS propertybase-paletteCSS at-rule descriptor (@font-palette-values)<baseline-position>CSS typebaseline-shiftCSS propertybaseline-sourceCSS property<basic-shape>CSS type::beforeCSS pseudo-element:blankCSS pseudo-class<blend-mode>CSS typeblock-sizeCSS propertyblur()CSS functionborderCSS propertyborder-blockCSS propertyborder-block-colorCSS propertyborder-block-endCSS propertyborder-block-end-colorCSS propertyborder-block-end-styleCSS propertyborder-block-end-widthCSS propertyborder-block-startCSS propertyborder-block-start-colorCSS propertyborder-block-start-styleCSS propertyborder-block-start-widthCSS propertyborder-block-styleCSS propertyborder-block-widthCSS propertyborder-bottomCSS propertyborder-bottom-colorCSS propertyborder-bottom-left-radiusCSS propertyborder-bottom-right-radiusCSS propertyborder-bottom-styleCSS propertyborder-bottom-widthCSS propertyborder-collapseCSS propertyborder-colorCSS propertyborder-end-end-radiusCSS propertyborder-end-start-radiusCSS propertyborder-imageCSS propertyborder-image-outsetCSS propertyborder-image-repeatCSS propertyborder-image-sliceCSS propertyborder-image-sourceCSS propertyborder-image-widthCSS propertyborder-inlineCSS propertyborder-inline-colorCSS propertyborder-inline-endCSS propertyborder-inline-end-colorCSS propertyborder-inline-end-styleCSS propertyborder-inline-end-widthCSS propertyborder-inline-startCSS propertyborder-inline-start-colorCSS propertyborder-inline-start-styleCSS propertyborder-inline-start-widthCSS propertyborder-inline-styleCSS propertyborder-inline-widthCSS propertyborder-leftCSS propertyborder-left-colorCSS propertyborder-left-styleCSS propertyborder-left-widthCSS propertyborder-radiusCSS propertyborder-rightCSS propertyborder-right-colorCSS propertyborder-right-styleCSS propertyborder-right-widthCSS propertyborder-spacingCSS propertyborder-start-end-radiusCSS propertyborder-start-start-radiusCSS propertyborder-styleCSS propertyborder-topCSS propertyborder-top-colorCSS propertyborder-top-left-radiusCSS propertyborder-top-right-radiusCSS propertyborder-top-styleCSS propertyborder-top-widthCSS propertyborder-widthCSS propertybottomCSS propertybox-decoration-breakCSS property<box-edge>CSS typebox-shadowCSS propertybox-sizingCSS propertybreak-afterCSS propertybreak-beforeCSS propertybreak-insideCSS propertybrightness()CSS function:bufferingCSS pseudo-class
C
- Class selectors
- Custom properties (--*): CSS variables
calc()CSS function<calc-keyword>CSS typecalc-size()CSS function<calc-sum>CSS typecaption-sideCSS propertycaretCSS propertycaret-animationCSS propertycaret-colorCSS propertycaret-shapeCSS property@charsetCSS at-rule:checkedCSS pseudo-class::checkmarkCSS pseudo-elementcircle()CSS functionclamp()CSS functionclearCSS propertyclip-pathCSS propertyclip-ruleCSS propertycolorCSS propertycolor()CSS functioncolor-interpolationCSS propertycolor-interpolation-filtersCSS property<color-interpolation-method>CSS typecolor-mix()CSS function@color-profileCSS at-rulecolor-schemeCSS property<color>CSS type::columnCSS pseudo-elementcolumn-countCSS propertycolumn-fillCSS propertycolumn-gapCSS propertycolumn-heightCSS propertycolumn-ruleCSS propertycolumn-rule-colorCSS propertycolumn-rule-styleCSS propertycolumn-rule-widthCSS propertycolumn-spanCSS propertycolumn-widthCSS propertycolumn-wrapCSS propertycolumnsCSS propertyconic-gradient()CSS functioncontainCSS propertycontain-intrinsic-block-sizeCSS propertycontain-intrinsic-heightCSS propertycontain-intrinsic-inline-sizeCSS propertycontain-intrinsic-sizeCSS propertycontain-intrinsic-widthCSS property@containerCSS at-rulecontainerCSS propertycontainer-nameCSS propertycontainer-typeCSS propertycontentCSS property<content-distribution>CSS type<content-position>CSS typecontent-visibilityCSS propertycontrast()CSS functioncontrast-color()CSS functioncorner-block-end-shapeCSS propertycorner-block-start-shapeCSS propertycorner-bottom-left-shapeCSS propertycorner-bottom-right-shapeCSS propertycorner-bottom-shapeCSS propertycorner-end-end-shapeCSS propertycorner-end-start-shapeCSS propertycorner-inline-end-shapeCSS propertycorner-inline-start-shapeCSS propertycorner-left-shapeCSS propertycorner-right-shapeCSS propertycorner-shapeCSS property<corner-shape-value>CSS typecorner-start-end-shapeCSS propertycorner-start-start-shapeCSS propertycorner-top-left-shapeCSS propertycorner-top-right-shapeCSS propertycorner-top-shapeCSS propertycos()CSS functioncounter()CSS functioncounter-incrementCSS propertycounter-resetCSS propertycounter-setCSS property@counter-styleCSS at-rulecounters()CSS functioncross-fade()CSS functioncubic-bezier()CSS function::cueCSS pseudo-element:currentCSS pseudo-classcursorCSS property<custom-ident>CSS type@custom-mediaCSS at-rulecxCSS propertycyCSS property
D
dCSS property<dashed-function>CSS type<dashed-ident>CSS type:defaultCSS pseudo-class:definedCSS pseudo-classdescent-overrideCSS at-rule descriptor (@font-face)::details-contentCSS pseudo-elementdevice-cmyk()CSS function<dimension>CSS type:dir()CSS pseudo-classdirectionCSS property:disabledCSS pseudo-classdisplayCSS property<display-box>CSS type<display-inside>CSS type<display-internal>CSS type<display-legacy>CSS type<display-listitem>CSS type<display-outside>CSS typedominant-baselineCSS propertydrop-shadow()CSS functiondynamic-range-limitCSS propertydynamic-range-limit-mix()CSS function
E
<easing-function>CSS typeelement()CSS functionellipse()CSS function:emptyCSS pseudo-classempty-cellsCSS property:enabledCSS pseudo-classenv()CSS functionexp()CSS function
F
fallbackCSS at-rule descriptor (@counter-style)field-sizingCSS property::file-selector-buttonCSS pseudo-elementfillCSS propertyfill-opacityCSS propertyfill-ruleCSS propertyfilterCSS property<filter-function>CSS type:firstCSS pseudo-class:first-childCSS pseudo-class::first-letterCSS pseudo-element::first-lineCSS pseudo-element:first-of-typeCSS pseudo-classfit-contentCSS keywordfit-content()CSS functionflexCSS propertyflex-basisCSS propertyflex-directionCSS propertyflex-flowCSS propertyflex-growCSS propertyflex-shrinkCSS propertyflex-wrapCSS property<flex>CSS typefloatCSS propertyflood-colorCSS propertyflood-opacityCSS property:focusCSS pseudo-class:focus-visibleCSS pseudo-class:focus-withinCSS pseudo-classfontCSS propertyfont-displayCSS at-rule descriptor (@font-face)font-displayCSS at-rule descriptor (@font-feature-values)@font-faceCSS at-rulefont-familyCSS at-rule descriptor (@font-face)font-familyCSS at-rule descriptor (@font-palette-values)font-familyCSS propertyfont-feature-settingsCSS at-rule descriptor (@font-face)font-feature-settingsCSS property@font-feature-valuesCSS at-rulefont-kerningCSS propertyfont-language-overrideCSS propertyfont-optical-sizingCSS propertyfont-paletteCSS property@font-palette-valuesCSS at-rulefont-sizeCSS propertyfont-size-adjustCSS propertyfont-stretchCSS at-rule descriptor (@font-face)font-stretchCSS propertyfont-styleCSS at-rule descriptor (@font-face)font-styleCSS propertyfont-synthesisCSS propertyfont-synthesis-positionCSS propertyfont-synthesis-small-capsCSS propertyfont-synthesis-styleCSS propertyfont-synthesis-weightCSS propertyfont-variantCSS propertyfont-variant-alternatesCSS propertyfont-variant-capsCSS propertyfont-variant-east-asianCSS propertyfont-variant-emojiCSS propertyfont-variant-ligaturesCSS propertyfont-variant-numericCSS propertyfont-variant-positionCSS propertyfont-variation-settingsCSS at-rule descriptor (@font-face)font-variation-settingsCSS propertyfont-weightCSS at-rule descriptor (@font-face)font-weightCSS propertyfont-widthCSS at-rule descriptor (@font-face)font-widthCSS propertyforced-color-adjustCSS property<frequency-percentage>CSS type<frequency>CSS type:fullscreenCSS pseudo-class@functionCSS at-rule:futureCSS pseudo-class
G
gapCSS property<generic-family>CSS type<gradient>CSS type::grammar-errorCSS pseudo-elementgrayscale()CSS functiongridCSS propertygrid-areaCSS propertygrid-auto-columnsCSS propertygrid-auto-flowCSS propertygrid-auto-rowsCSS propertygrid-columnCSS propertygrid-column-endCSS propertygrid-column-startCSS propertygrid-rowCSS propertygrid-row-endCSS propertygrid-row-startCSS propertygrid-templateCSS propertygrid-template-areasCSS propertygrid-template-columnsCSS propertygrid-template-rowsCSS property
H
hanging-punctuationCSS property:has()CSS pseudo-class:has-slottedCSS pseudo-class:headingCSS pseudo-class:heading()CSS pseudo-classheightCSS property<hex-color>CSS type::highlight()CSS pseudo-element:hostCSS pseudo-class:host()CSS pseudo-class:hoverCSS pseudo-classhsl()CSS function<hue-interpolation-method>CSS typehue-rotate()CSS function<hue>CSS typehwb()CSS functionhyphenate-characterCSS propertyhyphenate-limit-charsCSS propertyhyphensCSS propertyhypot()CSS function
I
- ID selectors
<ident>CSS typeif()CSS functionimage()CSS functionimage-orientationCSS propertyimage-renderingCSS propertyimage-resolutionCSS propertyimage-set()CSS function<image>CSS type@importCSS at-rule!importantCSS keyword:in-rangeCSS pseudo-class:indeterminateCSS pseudo-classinheritCSS keywordinheritsCSS at-rule descriptor (@property)initialCSS keywordinitial-letterCSS propertyinitial-valueCSS at-rule descriptor (@property)inline-sizeCSS propertyinsetCSS propertyinset()CSS functioninset-blockCSS propertyinset-block-endCSS propertyinset-block-startCSS propertyinset-inlineCSS propertyinset-inline-endCSS propertyinset-inline-startCSS property<integer>CSS typeinteractivityCSS propertyinterest-delayCSS propertyinterest-delay-endCSS propertyinterest-delay-startCSS property:interest-sourceCSS pseudo-class:interest-targetCSS pseudo-classinterpolate-sizeCSS property:invalidCSS pseudo-classinvert()CSS function:is()CSS pseudo-classisolationCSS property
J
K
L
lab()CSS function:lang()CSS pseudo-class:last-childCSS pseudo-class:last-of-typeCSS pseudo-class@layerCSS at-rulelayer()CSS functionlch()CSS functionleftCSS property:leftCSS pseudo-class<length-percentage>CSS type<length>CSS typeletter-spacingCSS propertylight-dark()CSS functionlighting-colorCSS propertyline-breakCSS propertyline-clampCSS propertyline-gap-overrideCSS at-rule descriptor (@font-face)line-heightCSS propertyline-height-stepCSS property<line-style>CSS typelinear()CSS functionlinear-gradient()CSS function:linkCSS pseudo-classlist-styleCSS propertylist-style-imageCSS propertylist-style-positionCSS propertylist-style-typeCSS property:local-linkCSS pseudo-classlog()CSS function
M
marginCSS propertymargin-blockCSS propertymargin-block-endCSS propertymargin-block-startCSS propertymargin-bottomCSS propertymargin-inlineCSS propertymargin-inline-endCSS propertymargin-inline-startCSS propertymargin-leftCSS propertymargin-rightCSS propertymargin-topCSS propertymargin-trimCSS propertymarkerCSS property::markerCSS pseudo-elementmarker-endCSS propertymarker-midCSS propertymarker-startCSS propertymaskCSS propertymask-borderCSS propertymask-border-modeCSS propertymask-border-outsetCSS propertymask-border-repeatCSS propertymask-border-sliceCSS propertymask-border-sourceCSS propertymask-border-widthCSS propertymask-clipCSS propertymask-compositeCSS propertymask-imageCSS propertymask-modeCSS propertymask-originCSS propertymask-positionCSS propertymask-repeatCSS propertymask-sizeCSS propertymask-typeCSS propertymath-depthCSS propertymath-shiftCSS propertymath-styleCSS propertymatrix()CSS functionmatrix3d()CSS functionmax()CSS functionmax-block-sizeCSS propertymax-contentCSS keywordmax-heightCSS propertymax-inline-sizeCSS propertymax-widthCSS property@mediaCSS at-rulemin()CSS functionmin-block-sizeCSS propertymin-contentCSS keywordmin-heightCSS propertymin-inline-sizeCSS propertymin-widthCSS propertyminmax()CSS functionmix-blend-modeCSS propertymod()CSS function:modalCSS pseudo-class:mutedCSS pseudo-class
N
- Namespace separator
<named-color>CSS type@namespaceCSS at-rulenegativeCSS at-rule descriptor (@counter-style)- & nesting selector
:not()CSS pseudo-class:nth-child()CSS pseudo-class:nth-last-child()CSS pseudo-class:nth-last-of-type()CSS pseudo-class:nth-of-type()CSS pseudo-class<number>CSS type
O
object-fitCSS propertyobject-positionCSS propertyobject-view-boxCSS propertyoffsetCSS propertyoffset-anchorCSS propertyoffset-distanceCSS propertyoffset-pathCSS propertyoffset-positionCSS propertyoffset-rotateCSS propertyoklab()CSS functionoklch()CSS function:only-childCSS pseudo-class:only-of-typeCSS pseudo-classopacityCSS propertyopacity()CSS function:openCSS pseudo-class:optionalCSS pseudo-classorderCSS propertyorphansCSS property:out-of-rangeCSS pseudo-classoutlineCSS propertyoutline-colorCSS propertyoutline-offsetCSS propertyoutline-styleCSS propertyoutline-widthCSS propertyoverflowCSS propertyoverflow-anchorCSS propertyoverflow-blockCSS propertyoverflow-clip-marginCSS propertyoverflow-inlineCSS property<overflow-position>CSS typeoverflow-wrapCSS propertyoverflow-xCSS propertyoverflow-yCSS property<overflow>CSS typeoverlayCSS propertyoverride-colorsCSS at-rule descriptor (@font-palette-values)overscroll-behaviorCSS propertyoverscroll-behavior-blockCSS propertyoverscroll-behavior-inlineCSS propertyoverscroll-behavior-xCSS propertyoverscroll-behavior-yCSS property
P
padCSS at-rule descriptor (@counter-style)paddingCSS propertypadding-blockCSS propertypadding-block-endCSS propertypadding-block-startCSS propertypadding-bottomCSS propertypadding-inlineCSS propertypadding-inline-endCSS propertypadding-inline-startCSS propertypadding-leftCSS propertypadding-rightCSS propertypadding-topCSS property@pageCSS at-rulepageCSS propertypage-orientationCSS at-rule descriptor (@page)paint()CSS functionpaint-orderCSS propertypalette-mix()CSS function::part()CSS pseudo-element:pastCSS pseudo-classpath()CSS function:pausedCSS pseudo-class<percentage>CSS typeperspectiveCSS propertyperspective()CSS functionperspective-originCSS property::picker()CSS pseudo-element::picker-iconCSS pseudo-element:picture-in-pictureCSS pseudo-classplace-contentCSS propertyplace-itemsCSS propertyplace-selfCSS property::placeholderCSS pseudo-element:placeholder-shownCSS pseudo-class:playingCSS pseudo-classpointer-eventsCSS propertypolygon()CSS function:popover-openCSS pseudo-classpositionCSS propertyposition-anchorCSS propertyposition-areaCSS property<position-area>CSS type@position-tryCSS at-ruleposition-tryCSS propertyposition-try-fallbacksCSS propertyposition-try-orderCSS propertyposition-visibilityCSS property<position>CSS typepow()CSS functionprefixCSS at-rule descriptor (@counter-style)print-color-adjustCSS propertyprogress()CSS function@propertyCSS at-rule
Q
R
rCSS propertyradial-gradient()CSS functionrandom()CSS functionrangeCSS at-rule descriptor (@counter-style)<ratio>CSS typeray()CSS function:read-onlyCSS pseudo-class:read-writeCSS pseudo-classreading-flowCSS propertyreading-orderCSS propertyrect()CSS function<relative-size>CSS typerem()CSS functionrepeat()CSS functionrepeating-conic-gradient()CSS functionrepeating-linear-gradient()CSS functionrepeating-radial-gradient()CSS function:requiredCSS pseudo-classresizeCSS property<resolution>CSS typerevertCSS keywordrevert-layerCSS keyword- revert-rule
rgb()CSS functionrightCSS property:rightCSS pseudo-class:rootCSS pseudo-classrotateCSS propertyrotate()CSS functionrotate3d()CSS functionrotateX()CSS functionrotateY()CSS functionrotateZ()CSS functionround()CSS functionrow-gapCSS propertyruby-alignCSS propertyruby-overhangCSS propertyruby-positionCSS property<rule-list>CSS typerxCSS propertyryCSS property
S
- Selector list
saturate()CSS functionscaleCSS propertyscale()CSS functionscale3d()CSS functionscaleX()CSS functionscaleY()CSS functionscaleZ()CSS function@scopeCSS at-rule:scopeCSS pseudo-classscroll()CSS functionscroll-behaviorCSS property::scroll-button()CSS pseudo-elementscroll-initial-targetCSS propertyscroll-marginCSS propertyscroll-margin-blockCSS propertyscroll-margin-block-endCSS propertyscroll-margin-block-startCSS propertyscroll-margin-bottomCSS propertyscroll-margin-inlineCSS propertyscroll-margin-inline-endCSS propertyscroll-margin-inline-startCSS propertyscroll-margin-leftCSS propertyscroll-margin-rightCSS propertyscroll-margin-topCSS property::scroll-markerCSS pseudo-elementscroll-marker-groupCSS property::scroll-marker-groupCSS pseudo-elementscroll-paddingCSS propertyscroll-padding-blockCSS propertyscroll-padding-block-endCSS propertyscroll-padding-block-startCSS propertyscroll-padding-bottomCSS propertyscroll-padding-inlineCSS propertyscroll-padding-inline-endCSS propertyscroll-padding-inline-startCSS propertyscroll-padding-leftCSS propertyscroll-padding-rightCSS propertyscroll-padding-topCSS propertyscroll-snap-alignCSS propertyscroll-snap-stopCSS propertyscroll-snap-typeCSS propertyscroll-target-groupCSS propertyscroll-timelineCSS propertyscroll-timeline-axisCSS propertyscroll-timeline-nameCSS propertyscrollbar-colorCSS propertyscrollbar-gutterCSS propertyscrollbar-widthCSS property::search-textCSS pseudo-element:seekingCSS pseudo-class::selectionCSS pseudo-element<self-position>CSS typesepia()CSS functionshape()CSS functionshape-image-thresholdCSS propertyshape-marginCSS propertyshape-outsideCSS propertyshape-renderingCSS propertysibling-count()CSS functionsibling-index()CSS functionsign()CSS functionsin()CSS functionsizeCSS at-rule descriptor (@page)size-adjustCSS at-rule descriptor (@font-face)skew()CSS functionskewX()CSS functionskewY()CSS function::slotted()CSS pseudo-elementspeak-asCSS at-rule descriptor (@counter-style)speak-asCSS property::spelling-errorCSS pseudo-elementsqrt()CSS functionsrcCSS at-rule descriptor (@font-face):stalledCSS pseudo-class@starting-styleCSS at-rule:state()CSS pseudo-classsteps()CSS functionstop-colorCSS propertystop-opacityCSS property<string>CSS typestrokeCSS propertystroke-dasharrayCSS propertystroke-dashoffsetCSS propertystroke-linecapCSS propertystroke-linejoinCSS propertystroke-miterlimitCSS propertystroke-opacityCSS propertystroke-widthCSS propertysuffixCSS at-rule descriptor (@counter-style)superellipse()CSS function@supportsCSS at-rulesymbolsCSS at-rule descriptor (@counter-style)symbols()CSS functionsyntaxCSS at-rule descriptor (@property)systemCSS at-rule descriptor (@counter-style)<system-color>CSS type
T
- Type selectors
tab-sizeCSS propertytable-layoutCSS propertytan()CSS function:targetCSS pseudo-class:target-afterCSS pseudo-class:target-beforeCSS pseudo-class:target-currentCSS pseudo-class::target-textCSS pseudo-elementtext-alignCSS propertytext-align-lastCSS propertytext-anchorCSS propertytext-autospaceCSS propertytext-boxCSS propertytext-box-edgeCSS propertytext-box-trimCSS propertytext-combine-uprightCSS propertytext-decorationCSS propertytext-decoration-colorCSS propertytext-decoration-insetCSS propertytext-decoration-lineCSS propertytext-decoration-skip-inkCSS propertytext-decoration-styleCSS propertytext-decoration-thicknessCSS property<text-edge>CSS typetext-emphasisCSS propertytext-emphasis-colorCSS propertytext-emphasis-positionCSS propertytext-emphasis-styleCSS propertytext-indentCSS propertytext-justifyCSS propertytext-orientationCSS propertytext-overflowCSS propertytext-renderingCSS propertytext-shadowCSS propertytext-size-adjustCSS propertytext-spacing-trimCSS propertytext-transformCSS propertytext-underline-offsetCSS propertytext-underline-positionCSS propertytext-wrapCSS propertytext-wrap-modeCSS propertytext-wrap-styleCSS property<time-percentage>CSS type<time>CSS type<timeline-range-name>CSS typetimeline-scopeCSS propertytopCSS propertytouch-actionCSS propertytransformCSS propertytransform-boxCSS property<transform-function>CSS typetransform-originCSS propertytransform-styleCSS propertytransitionCSS propertytransition-behaviorCSS propertytransition-delayCSS propertytransition-durationCSS propertytransition-propertyCSS propertytransition-timing-functionCSS propertytranslateCSS propertytranslate()CSS functiontranslate3d()CSS functiontranslateX()CSS functiontranslateY()CSS functiontranslateZ()CSS functiontype()CSS function
U
- Universal selectors
unicode-bidiCSS propertyunicode-rangeCSS at-rule descriptor (@font-face)unsetCSS keywordurl()CSS function<url>CSS type:user-invalidCSS pseudo-classuser-selectCSS property:user-validCSS pseudo-class
V
:validCSS pseudo-classvar()CSS functionvector-effectCSS propertyvertical-alignCSS propertyview()CSS functionview-timelineCSS propertyview-timeline-axisCSS propertyview-timeline-insetCSS propertyview-timeline-nameCSS property@view-transitionCSS at-rule::view-transitionCSS pseudo-elementview-transition-classCSS property::view-transition-group()CSS pseudo-element::view-transition-image-pair()CSS pseudo-elementview-transition-nameCSS property::view-transition-new()CSS pseudo-element::view-transition-old()CSS pseudo-elementvisibilityCSS property:visitedCSS pseudo-class:volume-lockedCSS pseudo-class
W
:where()CSS pseudo-classwhite-spaceCSS propertywhite-space-collapseCSS propertywidowsCSS propertywidthCSS propertywill-changeCSS propertyword-breakCSS propertyword-spacingCSS propertywriting-modeCSS property
X
Y
Z
Selectors
The following are the various selectors, which allow styles to be conditional based on various features of elements within the DOM.
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
AandBelements 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.
- Next-sibling combinator
A + B -
Specifies that the elements selected by both
AandBhave the same parent and that the element selected byBimmediately follows the element selected byAhorizontally. - Subsequent-sibling combinator
A ~ B -
Specifies that the elements selected by both
AandBshare the same parent and that the element selected byAcomes before—but not necessarily immediately before—the element selected byB. - Child combinator
A > B -
Specifies that the element selected by
Bis the direct child of the element selected byA. - Descendant combinator
A B -
Specifies that the element selected by
Bis a descendant of the element selected byA, but is not necessarily a direct child. - Column combinator
A || B -
Specifies that the element selected by
Bis located within the table column specified byA. Elements which span multiple columns are considered to be a member of all of those columns.
Pseudo
- Pseudo classes
: -
Specifies a special state of the selected element(s).
- Pseudo elements
:: -
Represents entities that are not included in HTML.
See also selectors in the Selectors specification and the pseudo-element specification.
Concepts
>Syntax and semantics
Values
Layout
DOM-CSS / CSSOM
>Major object types
Important methods
See also
- Mozilla CSS extensions (prefixed with
-moz-) - WebKit CSS extensions (mostly prefixed with
-webkit-)