A CSS transition animates a change in a property’s value. In a before-and-after portfolio image, the “after” picture starts invisible and appears when you hover over it. The transition makes that appearance gradual rather than instant. section 20.5
.image-overlay {
position: absolute;
left: 0;
top: 0;
width: 200px;
height: 156px;
z-index: 1;
opacity: 0;
transition: opacity 1.5s ease;
}
.image-overlay:hover {
opacity: 1;
}
The overlay starts at `opacity: 0`. Hovering changes it to `opacity: 1`, while `transition: opacity 1.5s ease` animates that change over 1.5 seconds. section 20.5




