Favorites

CSS animation-range Property

animation-range
CSS PropertyThis property is supported by all modern browsers.
Updated 22nd November 2026

The animation-range shorthand sets where a scroll-driven animation starts and ends on its timeline, such as entry 0% exit 100%.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The animation-range property sets the part of a scroll-driven animation's timeline during which the animation runs. It is a shorthand for animation-range-start and animation-range-end, and is used together with animation-timeline.

For a view progress timeline (animation-timeline: view()) the range is usually expressed with named ranges that describe the element's journey through the scrollport: cover (from first entering to fully leaving), contain, entry, exit, entry-crossing and exit-crossing. Each name can be followed by a percentage, so animation-range: entry 0% entry 100% (or simply animation-range: entry) runs the animation only while the element scrolls into view. Lengths and percentages without a name are measured along the whole timeline.

Keyframes outside the range are not shown unless animation-fill-mode (for example both) keeps the first and last frames applied. Note that the animation shorthand resets animation-range to normal, so declare the range after it.

Definition

Initial value
see individual properties
Applies to
all elements
Inherited
no
Computed value
see individual properties
Animatable
not animatable
JavaScript syntax
object.style.animationRange

Interactive Demo

Scroll down ↓

Scroll down ↓

Scroll down ↓

Scroll down ↓

Scroll down ↓

Scroll down ↓

Keep scrolling ↓

Keep scrolling ↓

Keep scrolling ↓

Keep scrolling ↓

Keep scrolling ↓

Keep scrolling ↓

Demo Code
HTML Code
<div class="demo-scroller">
	<p>Scroll down &darr;</p>
	<p>Scroll down &darr;</p>
	<p>Scroll down &darr;</p>
	<p>Scroll down &darr;</p>
	<p>Scroll down &darr;</p>
	<p>Scroll down &darr;</p>
	<div class="demo-element"></div>
	<p>Keep scrolling &darr;</p>
	<p>Keep scrolling &darr;</p>
	<p>Keep scrolling &darr;</p>
	<p>Keep scrolling &darr;</p>
	<p>Keep scrolling &darr;</p>
	<p>Keep scrolling &darr;</p>
	</div>
CSS Code
@keyframes demo-reveal {
	from { opacity: 0.15; transform: scale(0.4) rotate(-20deg); background: #4361ee; }
	to { opacity: 1; transform: scale(1) rotate(0); background: #f72585; }
}
.demo-scroller {
	height: 190px;
	width: 270px;
	overflow: auto;
	border: 1px solid #c5c5c5;
	background: #fafafa;
}
.demo-scroller p {
	margin: 0;
	padding: 10px 12px;
	color: #666;
}
.demo-element {
	width: 110px;
	height: 110px;
	margin: 10px auto;
	border-radius: 12px;
	animation: demo-reveal linear both;
	animation-timeline: view();
}
.demo-element {
	animation-range: normal;
}

Syntax

animation-range: [ <animation-range-start> <animation-range-end>? ]#;

Values

  • normalThe default. The animation is attached to the whole timeline.
  • <timeline-range-name>One of cover, contain, entry, exit, entry-crossing or exit-crossing. On its own it sets both the start (0%) and the end (100%) of that named range.
  • <timeline-range-name> <length-percentage>A point inside a named range, for example entry 25% or exit 100px.
  • <length-percentage>A point measured from the start of the whole timeline.
  • initialSets the property to its initial value.
  • inheritTakes the computed value of the parent element.

Example

<div class="spacer">Scroll down</div>
<div class="box">Fades in while entering the viewport</div>
<div class="spacer"></div>
.spacer {
  height: 90vh;
  font-family: system-ui, sans-serif;
}

@keyframes reveal {
  from { opacity: 0; scale: 0.6; }
  to   { opacity: 1; scale: 1; }
}

.box {
  width: 260px;
  margin: auto;
  padding: 30px;
  background: #4361ee;
  color: #fff;
  font-family: system-ui, sans-serif;
  animation: reveal linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 100%; /* only while entering */
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS animation-range property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.