On this page
opacity
Prev: `transform` | Up: motion | Next: `transition`
Rel: motion, Custom Properties & Animation Guide
Ref: MDN Web Docs — opacity
Tags: #public #web #css #properties #motion #tier/core
Syntax & Overview
opacity: 0.85;
Sets element transparency (0 to 1), animated directly on the GPU compositor.
- Initial:
1| Inherited: No | Animatable: Yes (compositor)
Notes & Best Practices
- GPU-composited and creates a new stacking context whenever
< 1. Noteopacity: 0still receives clicks unless paired withpointer-events: noneorvisibility: hidden.
Example
.modal-backdrop {
opacity: 0;
pointer-events: none;
transition: opacity 150ms ease;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
Linked from
Related notes
- tuts/css/properties/motion/transform Linked here; links to this page; shared tags: #css, #motion, #properties, #tier, #web
- tuts/css/properties/motion/transition Linked here; links to this page; shared tags: #css, #motion, #properties, #tier, #web
- tuts/css/properties/motion Linked here; links to this page; shared tags: #css, #motion, #properties, #web
- tuts/css/properties/custom_properties_and_animation Linked here; shared tags: #css, #properties, #web
- tuts/css/properties/motion/animation shared tags: #css, #motion, #properties, #tier, #web
- tuts/css/properties/motion/will-change shared tags: #css, #motion, #properties, #tier, #web
- tuts/css/properties/box_model/aspect-ratio shared tags: #css, #properties, #tier, #web
- tuts/css/properties/box_model/box-sizing shared tags: #css, #properties, #tier, #web
- tuts/css/properties/box_model/inline-size shared tags: #css, #properties, #tier, #web
- tuts/css/properties/box_model/margin shared tags: #css, #properties, #tier, #web