Interview Question

What is opacity in CSS?

opacity makes the complete rendered element group transparent.

💡 Concept ✅ Quick Revision 🎨 CSS

Answer

The opacity property applies transparency to an entire element after it is rendered. • Its value ranges from zero to one. • It affects the element and all of its descendants as one composited group. • Using a transparent color affects only that color rather than the whole subtree.

💡 Simple Example

.disabled { opacity: .5; }

⚡ Quick Revision

opacity makes the complete rendered element group transparent.