concept

transition-origin — CSS reference

While a CSS transition is active, its interpolated value has the highest cascade priority, even above important declarations. A transition must actually start after a change of the underlying value; merely declaring transition does not override other styles. Prefer reduced-motion-aware effects in real interfaces.

Formal Syntax & Structure

css syntaxcss
transition: opacity 1s linear;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a {opacity:0;transition:opacity 1s linear} #a.on {opacity:1!important}</style><body><p id="a">Transition sample</p><script>getComputedStyle(a).opacity; a.classList.add("on"); getComputedStyle(a).opacity; const t=a.getAnimations()[0]; if(t){t.pause();t.currentTime=500;}</script></body></html>
CSS Reference