Working Draft · css-overflow

CSS Overflow

27 properties, 7 selectors, 1 function defined by this specification, 22 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

-webkit-line-clamp

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

none | <integer [1,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
see individual properties
Inherited
see individual properties
Percentages
N/A
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
max-lines, block-ellipsis, continue

block-ellipsis

Property Experimental

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

no-ellipsis | ellipsis | <string>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
no-ellipsis
Applies to
block containers
Inherited
yes
Percentages
N/A
Computed value
specified value
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting block-ellipsis
Chrome No
Edge No
Firefox No
Safari Preview
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.

continue

Property Experimental

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

normal | discard | collapse | -webkit-legacy | overflow | paginate | fragments

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
block containers and multicol containers
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting continue
Chrome No
Edge No
Firefox No
Safari Preview
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.

line-clamp

Property Limited availability

MDN The line-clamp CSS property allows limiting of the contents of a block to the specified number of lines. Optionally, it also allows inserting content into the last line to indicate that content was truncated.

Live preview Example from MDN
/* layout for the cards */
section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  justify-content: space-between;
}
em {
  color: tomato;
}
.card {
  padding: 0.2rem;
  border: 1px solid tomato;
  border-radius: 0.2rem;
  max-width: 250px;
}

.integer {
  line-clamp: 2;
  overflow: hidden;
}
.no-ellipsis {
  line-clamp: 2 no-ellipsis;
  overflow: hidden;
}
.string {
  line-clamp: 2 "… (my custom text)";
  overflow: hidden;
}

Syntax

none | [<'max-lines'> || <'block-ellipsis'>] -webkit-legacy?

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
see individual properties
Inherited
see individual properties
Percentages
N/A
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
max-lines, block-ellipsis, continue

Browser support

First browser version supporting line-clamp
Chrome 6 (-webkit- prefix)
Edge 79 (-webkit- prefix)
Firefox 68 (-webkit- prefix)
Safari Preview
Chrome Android 18 (-webkit- prefix)
Safari iOS 4.2 (-webkit- prefix)

First version with support, from MDN browser-compat-data.

max-lines

Property Experimental

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

auto || <integer [1,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
block containers which are also either line-clamp containers or fragmentation containers that capture region breaks
Inherited
no
Percentages
N/A
Computed value
the keyword auto, or an integer, or both
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting max-lines
Chrome No
Edge No
Firefox No
Safari Preview
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.

overflow

Property Baseline: widely availablesince September 2022

MDN The overflow CSS shorthand property sets the desired behavior when content does not fit in the element's padding box (overflows) in the horizontal and/or vertical direction.

Live preview Example from MDN
#example-element {
  width: 15em;
  height: 9em;
  border: medium dotted;
  padding: 0.75em;
  text-align: left;
}

Syntax

<'overflow-block'>{1,2}

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
visible
Applies to
block containers [CSS2], flex containers [CSS3-FLEXBOX], and grid containers [CSS3-GRID-LAYOUT]
Inherited
no
Percentages
N/A
Computed value
see individual properties
Canonical order
per grammar
Animation type
discrete
Longhands
overflow-x, overflow-y

Browser support

First browser version supporting overflow
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

overflow-block

Property Baseline: widely availablesince March 2026 Modern CSS: Overflow media queries

MDN The overflow-block CSS media feature can be used to test how the output device handles content that overflows the initial containing block along the block axis.

Syntax

visible | hidden | clip | scroll | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
visible
Applies to
block containers [CSS2], flex containers [CSS-FLEXBOX-1], grid containers [CSS-GRID-1], and table grid boxes [CSS-TABLES-3]
Inherited
no
Percentages
N/A
Computed value
usually specified value, but see text
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting overflow-block
Chrome 113
Edge 113
Firefox 66
Safari 17
Chrome Android 113
Safari iOS 17

First version with support, from MDN browser-compat-data.

overflow-clip-margin

Property Limited availability Modern CSS: overflow-clip-margin

MDN The overflow-clip-margin CSS property determines how far outside its bounds an element with overflow: clip may be painted before being clipped. The bound defined by this property is called the overflow clip edge of the box.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
overflow-clip-margin-top, overflow-clip-margin-right, overflow-clip-margin-bottom, overflow-clip-margin-left

Browser support

First browser version supporting overflow-clip-margin
Chrome 90
Edge 90
Firefox 102
Safari No
Chrome Android 90
Safari iOS No

First version with support, from MDN browser-compat-data.

overflow-clip-margin-block

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
overflow-clip-margin-block-start, overflow-clip-margin-block-end

overflow-clip-margin-block-end

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-block-start

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-bottom

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-inline

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
overflow-clip-margin-inline-start, overflow-clip-margin-inline-end

overflow-clip-margin-inline-end

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-inline-start

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-left

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-right

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-clip-margin-top

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<visual-box> || <length>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0px
Applies to
boxes to which overflow applies
Inherited
no
Percentages
see individual properties
Computed value
the computed <length> and a <visual-box> keyword
Canonical order
per grammar
Animation type
per computed value if the <visual-box> values match; otherwise discrete

overflow-inline

Property Baseline: widely availablesince March 2026 Modern CSS: Overflow media queries

MDN The overflow-inline CSS media feature can be used to test how the output device handles content that overflows the initial containing block along the inline axis.

Syntax

visible | hidden | clip | scroll | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
visible
Applies to
block containers [CSS2], flex containers [CSS-FLEXBOX-1], grid containers [CSS-GRID-1], and table grid boxes [CSS-TABLES-3]
Inherited
no
Percentages
N/A
Computed value
usually specified value, but see text
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting overflow-inline
Chrome 113
Edge 113
Firefox 66
Safari 17
Chrome Android 113
Safari iOS 17

First version with support, from MDN browser-compat-data.

overflow-x

Property Baseline: widely availablesince September 2022

MDN The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the overflow shorthand property.

Live preview Example from MDN
#example-element {
  width: 15em;
  height: 9em;
  border: medium dotted;
  padding: 0.75em;
  text-align: left;
}

Syntax

visible | hidden | clip | scroll | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
visible
Applies to
block containers [CSS2], flex containers [CSS-FLEXBOX-1], grid containers [CSS-GRID-1], and table grid boxes [CSS-TABLES-3]
Inherited
no
Percentages
N/A
Computed value
usually specified value, but see text
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting overflow-x
Chrome 1
Edge 12
Firefox 3.5
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

overflow-y

Property Baseline: widely availablesince September 2022

MDN The overflow-y CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. This property may also be set by using the overflow shorthand property.

Live preview Example from MDN
#example-element {
  width: 15em;
  height: 9em;
  border: medium dotted;
  padding: 0.75em;
  text-align: left;
}

Syntax

visible | hidden | clip | scroll | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
visible
Applies to
block containers [CSS2], flex containers [CSS-FLEXBOX-1], grid containers [CSS-GRID-1], and table grid boxes [CSS-TABLES-3]
Inherited
no
Percentages
N/A
Computed value
usually specified value, but see text
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting overflow-y
Chrome 1
Edge 12
Firefox 3.5
Safari 3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

scroll-axis-lock

Property Limited availability Experimental Modern CSS: scroll-axis-lock

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

auto | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
scroll container elements
Inherited
no
Percentages
n/a
Computed value
specified value
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting scroll-axis-lock
Chrome 153
Edge No
Firefox No
Safari No
Chrome Android No
Safari iOS No

First version with support, from MDN browser-compat-data.

scroll-behavior

Property Baseline: widely availablesince September 2024

MDN The scroll-behavior CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs.

Live preview Example from MDN
.container {
  flex-direction: column;
}

.nav a {
  color: #009e5f;
}

scroll-container {
  border: 1px solid black;
  display: block;
  height: 200px;
  overflow-y: scroll;
  width: 200px;
}

scroll-page {
  align-items: center;
  display: flex;
  font-size: 5em;
  height: 100%;
  justify-content: center;
}

Syntax

auto | smooth

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
scroll containers
Inherited
no
Percentages
n/a
Computed value
specified value
Canonical order
per grammar
Animation type
not animatable

Browser support

First browser version supporting scroll-behavior
Chrome 61
Edge 79
Firefox 36
Safari 15.4
Chrome Android 61
Safari iOS 15.4

First version with support, from MDN browser-compat-data.

scroll-marker-group

Property Limited availability Experimental Modern CSS: Scroll markers

MDN The scroll-marker-group CSS property controls whether a scroll container element has a ::scroll-marker-group pseudo-element generated. If present, the property also specifies whether the scroll marker group should be placed before or after the contents of the scroll group container in the default visual and tab order.

Live preview Example from MDN
ul {
  display: flex;
  gap: 4vw;
  padding-left: 0;
  margin: 32px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;

  scroll-marker-group: after;
}

li {
  list-style-type: none;
  background-color: #eeeeee;
  flex: 0 0 33%;
  scroll-snap-align: start;
  text-align: center;
  line-height: 5;
}

li::scroll-marker {
  content: " ";
  border: 1px solid red;
  height: 1em;
  width: 1em;
}

::scroll-marker-group {
  display: flex;
  gap: 0.2em;
}

::scroll-marker:target-current {
  background: red;
}

fieldset {
  width: 20em;
}

label {
  font-family: monospace;
  display: block;
}

:has([value="before"]:checked) ul {
  scroll-marker-group: before;
}
:has([value="after"]:checked) ul {
  scroll-marker-group: after;
}

:has([value="none"]:checked) ul {
  scroll-marker-group: none;
}

Syntax

none | [ [ before | after ] || [ links | tabs ] ]

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
scroll containers
Inherited
no
Percentages
n/a
Computed value
specified keyword(s)
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting scroll-marker-group
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.

scroll-target-group

Property Limited availability Experimental Modern CSS: scroll-target-group

MDN The scroll-target-group CSS property specifies whether an element is a scroll marker group container.

Live preview Example from MDN
body {
  font: 1.2em / 1.5 system-ui;
  width: 50%;
  max-width: 700px;
  margin: 0 auto;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

section {
  padding-top: 60px;
}

a {
  color: black;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

ol {
  display: flex;
  width: 100%;
  justify-content: space-around;
  list-style-type: none;
  padding: 20px 0;
  margin: 0;
  background: white;
}

ol {
  scroll-target-group: auto;
}

:target-current {
  color: red;
}

Syntax

none | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements
Inherited
no
Percentages
n/a
Computed value
specified value
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting scroll-target-group
Chrome 140
Edge 140
Firefox No
Safari No
Chrome Android 140
Safari iOS No

First version with support, from MDN browser-compat-data.

scrollbar-gutter

Property Baseline: newly availablesince December 2024 Modern CSS: scrollbar-gutter

MDN The scrollbar-gutter CSS property allows authors to reserve space for the scrollbar, preventing unwanted layout changes as the content grows while also avoiding unnecessary visuals when scrolling isn't needed.

Syntax

auto | stable && both-edges?

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
scroll containers
Inherited
no
Percentages
n/a
Computed value
specified keyword(s)
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting scrollbar-gutter
Chrome 94
Edge 94
Firefox 97
Safari 18.2
Chrome Android 94
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

text-overflow

Property Baseline: widely availablesince January 2018

MDN The text-overflow CSS property sets how hidden overflow content is signaled to users.

Live preview Example from MDN
#example-element-container {
  width: 100%;
  max-width: 18em;
}

#example-element {
  line-height: 50px;
  border: 1px solid #c5c5c5;
  overflow: hidden;
  white-space: nowrap;
  font-family: sans-serif;
  padding: 0 0.5em;
  text-align: left;
}

Syntax

[ clip | ellipsis | <string> | fade | <fade()> ]{1,2}

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
clip
Applies to
block containers
Inherited
no
Percentages
refer to the width of the line box
Computed value
as specified, with lengths made absolute
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting text-overflow
Chrome 1
Edge 12
Firefox 7
Safari 1.3
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

::nth-fragment()

Selector Not in any browser yet

Spec The ::nth-fragment() pseudo-element is a pseudo-element that describes some of the fragment boxes generated by an element. The argument to the pseudo-element takes the same syntax as the argument to the :nth-child() pseudo-class defined in [SELECT], and has the same meaning except that the number is relative to fragment boxes generated by the element instead of siblings of the element.

::scroll-button()

Selector Limited availability Experimental Modern CSS: ::scroll-button

MDN The ::scroll-button() CSS pseudo-element represents a button for controlling the scrolling of a scroll container. They are generated on scroll containers when their content value is not none. The direction of the scrolling is determined by the parameter value.

Live preview Example from MDN
ul {
  display: flex;
  gap: 4vw;
  padding-left: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

li {
  list-style-type: none;
  background-color: #eeeeee;
  flex: 0 0 100%;
  height: 100px;
  padding-top: 20px;
  scroll-snap-align: start;
  text-align: center;
}

ul::scroll-button(*) {
  border: 0;
  font-size: 2rem;
  background: none;
  color: black;
  opacity: 0.7;
  cursor: pointer;
}

ul::scroll-button(*):hover,
ul::scroll-button(*):focus {
  opacity: 1;
}

ul::scroll-button(*):active {
  translate: 1px 1px;
}

ul::scroll-button(*):disabled {
  opacity: 0.2;
  cursor: unset;
}

ul::scroll-button(left) {
  content: "◄";
}

ul::scroll-button(right) {
  content: "►";
}

Syntax

::scroll-button( '*' | <scroll-button-direction> )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::scroll-button()
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.

::scroll-marker

Selector Limited availability Experimental Modern CSS: Scroll markers

Spec When the computed content value of a ::scroll-marker pseudo-element is not none and its nearest ancestor scroll container scroll container has a computed scroll-marker-group property that is not none, the pseudo-element generates a box attached as a child of the ::scroll-marker-group pseudo-element’s generated box on its nearest ancestor scroll container. These boxes are added in the tree order of their originating element.

MDN The ::scroll-marker CSS pseudo-element can be generated inside any element and represents its scroll marker. All elements can have a ::scroll-marker pseudo-element, which is placed into the ::scroll-marker-group of the nearest scroll container ancestor. A scroll marker behaves like an anchor (<a> element) whose scroll target is the marker's originating element — and scrolls the scroll container to that element when activated.

Live preview Example from MDN
ul {
  display: flex;
  gap: 4vw;
  padding-left: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-marker-group: after;
}

li {
  list-style-type: none;
  background-color: #eeeeee;
  flex: 0 0 33%;
  height: 100px;
  padding-top: 20px;
  scroll-snap-align: start;
  text-align: center;
}

li::scroll-marker {
  content: "";
  border: 1px solid red;
  height: 1em;
  width: 1em;
}

::scroll-marker-group {
  display: flex;
  gap: 0.4em;
  place-content: center;
}

::scroll-marker:target-current {
  background: red;
}

Syntax

::scroll-marker

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::scroll-marker
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.

::scroll-marker-group

Selector Limited availability Experimental Modern CSS: Scroll markers

Spec The ::scroll-marker-group fully styleable pseudo-element is generated by a scroll container element having a computed scroll-marker-group property that is not none.

MDN The ::scroll-marker-group CSS pseudo-element is generated inside a scroll container and contains any ::scroll-marker pseudo-elements generated on descendants of the scroll container.

Live preview Example from MDN
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica", "Arial", sans-serif;
}

ul {
  display: flex;
  gap: 4vw;
  padding-left: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
}

li {
  list-style-type: none;
  background-color: #eeeeee;
  flex: 0 0 100%;
  height: 200px;
  padding-top: 20px;
  scroll-snap-align: start;
  text-align: center;
}

ul {
  scroll-marker-group: after;
}

ul::scroll-marker-group {
  display: flex;
  justify-content: center;
  gap: 20px;
}

li::scroll-marker {
  width: 16px;
  height: 16px;
  background-color: transparent;
  border: 2px solid black;
  border-radius: 50%;
  content: "";
}

li::scroll-marker:target-current {
  background-color: black;
}

Syntax

::scroll-marker-group

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::scroll-marker-group
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.

:target-after

Selector Limited availability Experimental Modern CSS: Scroll marker target pseudo-classes

Spec In addition to the :target-current pseudo-class, this specification introduces the :target-before and :target-after pseudo-classes for use with scroll marker elements.

MDN The :target-after CSS pseudo-class selects scroll markers that come after the active scroll marker (the one that currently matches :target-current) within a scroll marker group. You can use this selector to style navigation items that come after the current navigation position within a scroll marker group.

Live preview Example from MDN
body {
  font: 1.2em / 1.5 system-ui;
  width: 50%;
  max-width: 700px;
  margin: 0 auto;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

section {
  padding-top: 60px;
}

a {
  color: black;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

ol {
  display: flex;
  width: 100%;
  justify-content: space-around;
  list-style-type: none;
  padding: 20px 0;
  margin: 0;
  background: white;
}

@supports not selector(:target-after) {
  body::before {
    content: "Your browser does not support the :target-before and :target-after pseudo-classes.";
    color: black;
    background-color: #ffcd33;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
  }
}

ol {
  scroll-target-group: auto;
}

:target-current {
  color: red;
}

a:target-before {
  color: gray;
  text-decoration: line-through;
}

a:target-after {
  text-decoration: underline orange 2px;
}

Syntax

:target-after

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting :target-after
Chrome 142
Edge 142
Firefox No
Safari No
Chrome Android 142
Safari iOS No

First version with support, from MDN browser-compat-data.

:target-before

Selector Limited availability Experimental Modern CSS: Scroll marker target pseudo-classes

Spec In addition to the :target-current pseudo-class, this specification introduces the :target-before and :target-after pseudo-classes for use with scroll marker elements.

MDN The :target-before CSS pseudo-class selects scroll markers that come before the active scroll marker (the one that currently matches :target-current) within a scroll marker group. You can use this selector to style navigation items that come before the current navigation position within a scroll marker group.

Live preview Example from MDN
body {
  font: 1.2em / 1.5 system-ui;
  width: 50%;
  max-width: 700px;
  margin: 0 auto;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

section {
  padding-top: 60px;
}

a {
  color: black;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

ol {
  display: flex;
  width: 100%;
  justify-content: space-around;
  list-style-type: none;
  padding: 20px 0;
  margin: 0;
  background: white;
}

@supports not selector(:target-before) {
  body::before {
    content: "Your browser does not support the :target-before and :target-after pseudo-classes.";
    color: black;
    background-color: #ffcd33;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
  }
}

ol {
  scroll-target-group: auto;
}

:target-current {
  color: red;
}

a:target-before {
  color: gray;
  text-decoration: line-through;
}

a:target-after {
  text-decoration: underline orange 2px;
}

Syntax

:target-before

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting :target-before
Chrome 142
Edge 142
Firefox No
Safari No
Chrome Android 142
Safari iOS No

First version with support, from MDN browser-compat-data.

:target-current

Selector Limited availability Experimental Modern CSS: Scroll marker target pseudo-classes

Spec Exactly one scroll marker within each scroll marker group is determined to be active at a time. Such "active" scroll markers match the :target-current pseudo-class.

MDN The :target-current CSS pseudo-class selects the active scroll marker — the scroll marker of a scroll-marker-group that is currently scrolled to. This selector can be used to style the active navigation position within a scroll marker group.

Syntax

:target-current

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting :target-current
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.

fade()

Function Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

/* for text-overflow */
fade( [ <length-percentage> ] )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Defined for

text-overflow

This feature only appears in the context of these properties, functions or types.