CSS @starting-style At-Rule

Beginner
3 examples
Updated: Nov 2026

Definition and Usage

The @starting-style at-rule defines the starting values used for an element's first style update. Pair it with transitions so dialogs and popovers can fade or slide in smoothly.

CSS Syntax

syntax.css
.toast {
  opacity: 1;
  transition: opacity .3s;
}
@starting-style {
  .toast { opacity: 0; }
}

Key Parts

PartPurposeTry it
nested blockPut starting values inside the element ruleTry it
standaloneWrap selectors in @starting-style { ... }Try it
with transitionAnimate from the starting values on first paintTry it

CSS Examples

Fade in on open

example.css
.toast {
  opacity: 1;
  transition: opacity .35s ease;
}
@starting-style {
  .toast { opacity: 0; }
}
Try It Yourself

Nested form

example.css
.panel {
  transform: translateY(0);
  transition: transform .3s;
  @starting-style {
    transform: translateY(12px);
  }
}
Try It Yourself

Browser Support

@starting-style is a modern CSS at-rule.

✓ Modern CSS

@starting-style

Check current browsers before relying on advanced behavior.

90% Modern browsers
Google Chrome Recent
Full support
Mozilla Firefox Recent
Full support
Apple Safari Recent
Full support
Microsoft Edge Recent
Full support
@starting-style Modern support

Bottom line: Use progressive enhancement. Keep a readable fallback when a browser ignores the at-rule.

Frequently Asked Questions

Without it, the browser has no from-value for the first frame when an element appears.
No. Use it for entry transitions tied to style changes; use @keyframes for named animation sequences.
Yes, that is a common use with dialogs and popovers that become displayable.
No. Any transitionable property can start from a declared starting value.
Supported in current Chromium and Safari; check Firefox for the latest status.

Next: @counter-style

Continue with @counter-style.

@counter-style tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

3 people found this page helpful