Favorites

CSS <custom-ident> Data Type

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

The <custom-ident> data type is a name you choose, such as an animation, grid area or counter name. It is case-sensitive and not quoted.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The <custom-ident> CSS data type represents a name chosen by the author, used as an identifier rather than as a keyword that CSS already knows. Whenever you give something your own name in a stylesheet, such as an animation, a counter, a grid line, a container or a view transition, that name is a <custom-ident>. Properties that accept it include animation-name, counter-reset, counter-increment, grid-area, container-name, list-style-type (for names defined with @counter-style) and view-transition-name.

A <custom-ident> follows the same rules as any CSS identifier. It can contain letters, digits, hyphens (-), underscores (_) and non-ASCII characters, but it must not start with a digit, and it must not start with a hyphen followed by a digit. Other characters, such as spaces or punctuation, can be included by escaping them with a backslash. Unlike most CSS keywords, a <custom-ident> is case-sensitive, so Slide and slide are two different names.

Some names are reserved and cannot be used. The CSS-wide keywords initial, inherit, unset, revert and revert-layer, as well as default, are never valid. Individual properties also exclude their own keywords; for example, none cannot be used as an animation name because animation-name: none already has a meaning.

Examples:

/* Naming an animation */
@keyframes slide-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.panel {
  animation-name: slide-in;
}

/* Naming a counter */
article {
  counter-reset: section;
}

h2::before {
  counter-increment: section;
  content: counter(section) ". ";
}

/* Naming a container for container queries */
.sidebar {
  container-name: sidebar;
  container-type: inline-size;
}

Names that start with two hyphens form a related type, <dashed-ident>, which is used for custom properties and other author-defined names.

Interactive Demo

head
side
main
foot
Demo Code
HTML Code
<div class="demo-element">
	<div class="demo-head">head</div>
	<div class="demo-side">side</div>
	<div class="demo-main">main</div>
	<div class="demo-foot">foot</div>
</div>
CSS Code
.demo-element > div {
	padding: 10px;
	background: #4361ee;
	color: #fff;
	font-size: 13px;
	font-weight: bold;
}
.demo-head {
	grid-area: head;
}
.demo-side {
	grid-area: side;
	background: #2a9d8f !important;
}
.demo-main {
	grid-area: main;
	background: #f72585 !important;
}
.demo-foot {
	grid-area: foot;
}
.demo-element {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 6px;
	width: 290px;
	grid-template-areas: "head head" "side main" "foot foot";
}

Syntax

property: <custom-ident>;

Values

  • <custom-ident>Any valid CSS identifier made of letters (a-z, A-Z), digits (0-9), hyphens, underscores, non-ASCII characters and escaped characters. It must not start with a digit, or with a hyphen followed by a digit. It is case-sensitive and cannot be one of the CSS-wide keywords (initial, inherit, unset, revert, revert-layer) or default.

Example

<section class="steps">
<h1>CSS &lt;custom-ident&gt; example</h1>
<div class="step">Counter named <strong>step</strong> numbers each item.</div>
<div class="step">Animation named <strong>fade-up</strong> brings it in.</div>
<div class="step">Both names are &lt;custom-ident&gt; values.</div>
</section>
/* Demonstrates  names for a counter and an animation */
* { box-sizing: border-box; }

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

.steps {
  max-width: 640px;
  margin: 0 auto;
  /* "step" is a custom-ident naming the counter */
  counter-reset: step;
}

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

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  /* "fade-up" is a custom-ident naming the animation */
  animation: fade-up 600ms ease both;
}

.step:nth-child(3) { animation-delay: 150ms; }
.step:nth-child(4) { animation-delay: 300ms; }

.step::before {
  counter-increment: step;
  content: counter(step);
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b69ff;
  color: #fff;
  font-weight: 700;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS custom-ident 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
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee