Opacity
Opacity is the visual property specifying how opaque or transparent a rendered element or color appears.
Web Design Playground, Second Edition
The CSS opacity property specifies the degree to which an element and its contents are transparent.
- How it is used
- Controls when photo-gallery captions and before-and-after portfolio images appear on hover.
- How deep it goes
- Demonstrates opacity values of 0 and 1 in CSS and animates their change with a transition; does not explain rendering internals.
- Examples
- Shows a thumbnail caption and a before-and-after book-restoration image overlay, each hidden initially and revealed on hover.
- What you can do after
- Build it from scratch: create captions or image overlays that appear on hover, with an optional animated opacity transition.
Read how Web Design Playground, Second Edition explains opacity →
CSS in Depth, Second Edition
The CSS opacity property specifies the compositing opacity of an element and its contents.
- How it is used
- Fades dropdowns and navigation labels into view as their states change.
- How deep it goes
- Defines the 0–1 range and works through a dropdown fade, its transparent click target, and a delayed-visibility fix.
- Examples
- Uses a dropdown that blocks a link while transparent, then pairs its fade with delayed visibility.
- What you can do after
- Build it from scratch: fade a dropdown while hiding its transparent drawer after the fade completes.
Tiny CSS Projects
The CSS opacity property controls the transparency of an element and its rendered contents.
- How it is used
- Uses opacity to establish visual hierarchy and reveal secondary card content during hover and keyboard-focus interactions.
- How deep it goes
- Demonstrates concrete values and animated state changes, but does not develop opacity beyond these interface examples.
- Examples
- Uses summary-card content reveals and translucent credit-card labels as concrete applications.
- What you can do after
- Apply opacity to hide interactive content visually, animate reveals, and de-emphasize supporting labels.
Also covered in
- Timeless Algorithms, The Foundational IdeasIn early access (MEAP)
- Web Design Playground
What to know first
- calc()The CSS calc() function evaluates an arithmetic expression involving compatible CSS values and units to produce a computed value.
- Document Object ModelThe Document Object Model is a platform-independent programming interface that represents a document as a structured tree of nodes and provides ways to access and modify its content and structure.
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
Related concepts
- CSSused by · CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- display propertyalternative to · The CSS property that specifies how an element generates boxes and participates in layout.
- globalAlphaconfigured by · globalAlpha is a Canvas rendering-context property that sets the transparency applied to subsequent drawing operations.
- hoverconfigured by · Hover is the interface state or interaction triggered when a pointing device is positioned over an element without activating it.
- style propertykind of · A style property is a named setting or interface attribute that specifies or exposes a presentation characteristic of an element or view.
- transitionused by · A CSS transition interpolates changes in a CSS property’s value over time when that value changes.
Questions about opacity
What is opacity?
Opacity is the visual property specifying how opaque or transparent a rendered element or color appears.
Which Manning books explain opacity?
Web Design Playground, Second Edition, CSS in Depth, Second Edition and Tiny CSS Projects.
What should I know before learning opacity?
Manning books that teach opacity usually introduce calc(), Document Object Model and JavaScript first.
What is the difference between opacity and display property?
Opacity is the visual property specifying how opaque or transparent a rendered element or color appears. The CSS property that specifies how an element generates boxes and participates in layout.
What is opacity a kind of?
Opacity is a kind of style property. A style property is a named setting or interface attribute that specifies or exposes a presentation characteristic of an element or view.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


