Favorites

CSS <timeline-range-name> Data Type

<timeline-range-name>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <timeline-range-name> data type names a phase of a view timeline, such as cover, contain, entry or exit, used to set the range of a scroll-driven animation.

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 <timeline-range-name> CSS data type names a phase of a view progress timeline, the timeline that tracks an element as it scrolls into and out of view. It is used in scroll-driven animations by animation-range, animation-range-start and animation-range-end, and in keyframe selectors such as entry 50%, to say during which part of that journey an animation should run.

There are six names. cover is the whole journey, from the moment the element starts to enter the scrollport until it has completely left. contain is the part where the element is fully visible (or, if it is larger than the scrollport, where it fully covers it). entry is the phase in which the element is entering, and exit the phase in which it is leaving. entry-crossing and exit-crossing measure the element crossing the start and end edges of the scrollport, which differs from entry and exit when the element is taller than the scrollport.

Each name is usually followed by a percentage or length that gives a point within the phase, so entry 0% is the moment the element first appears and entry 100% is the moment it has fully entered. If the percentage is left out, the start of the range defaults to 0% and the end to 100%.

Examples:

/* Fade cards in while they enter the viewport */
.card {
  animation: fade-in linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 100%;
}

/* Run only while the element is fully visible */
.parallax {
  animation-timeline: view();
  animation-range: contain;
}

/* Phase names inside keyframes */
@keyframes reveal {
  entry 0%   { opacity: 0; }
  entry 100% { opacity: 1; }
  exit 100%  { opacity: 0; }
}

Interactive Demo

Scroll down

Box

Keep scrolling

Demo Code
HTML Code
<div class="demo-scroller">
	<p>Scroll down</p>
	<div class="demo-element">Box</div>
	<p>Keep scrolling</p>
</div>
CSS Code
@keyframes demo-grow {
	from {
		scale: 0.3;
		background: #c5c5c5;
	}
	to {
		scale: 1;
		background: #f72585;
	}
}
.demo-scroller {
	width: 280px;
	height: 170px;
	overflow-y: scroll;
	background: #f4f4f4;
	outline: 1px dashed #b0b0b0;
}
.demo-scroller p {
	margin: 0;
	padding: 70px 10px;
	color: #666;
	font-size: 13px;
	text-align: center;
}
.demo-scroller .demo-element {
	width: 120px;
	height: 70px;
	margin: 0 auto;
	display: grid;
	place-items: center;
	color: #fff;
	font-weight: bold;
}
.demo-element {
	animation: demo-grow linear both;
	animation-timeline: view();
	animation-range: cover;
}

Syntax

<timeline-range-name> = cover | contain | entry | exit | entry-crossing | exit-crossing

Values

  • coverThe full range: from when the element starts entering the scrollport to when it has completely left.
  • containThe range in which the element is fully inside the scrollport (or fully covers it, if it is larger).
  • entryThe range in which the element is entering the scrollport.
  • exitThe range in which the element is leaving the scrollport.
  • entry-crossingThe range in which the element crosses the end edge of the scrollport, where it enters.
  • exit-crossingThe range in which the element crosses the start edge of the scrollport, where it leaves.

Example

<div class="wrap">
<h1>CSS &lt;timeline-range-name&gt; examples</h1>
<div class="scroller">
<div class="item entry">animation-range: entry (grows in as it enters)</div>
<div class="item contain">animation-range: contain (tints while fully visible)</div>
<div class="item exit">animation-range: exit (slides out as it leaves)</div>
</div>
<p class="note">Scroll the gray box to see each range in action.</p>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.scroller {
  height: 260px;
  overflow-y: auto;
  padding: 120px 16px;
  border-radius: 12px;
  background: #e2e8f0;
}

.item {
  margin: 0 0 120px;
  padding: 20px;
  border-radius: 10px;
  background: #fff;
  font-weight: 600;
  animation-timeline: view();
  animation-fill-mode: both;
  animation-timing-function: linear;
}

.entry { animation-name: grow; animation-range: entry 0% entry 100%; }
.contain { animation-name: tint; animation-range: contain; }
.exit { animation-name: fade; animation-range: exit 0% exit 100%; }

@keyframes grow { from { transform: scale(0.6); opacity: 0; } }
@keyframes tint { from { background: #fff; } to { background: #bfdbfe; } }
@keyframes fade { to { opacity: 0; transform: translateX(80px); } }
Open in editor

Browser Support

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

This data type 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.