June 2025
Beginner
817 pages
31h 30m
English
In the examples with mouse hovering and using transform, the transition of the effects was a bit messy after all. For example, in /examples/chapter014/14_5_5/index.html, which is shown in Figure 14.55, if you place the mouse cursor over the image, the graphic gets immediately scaled up and rotated, just like a light switch, and then immediately returned to its normal position when you move the mouse somewhere else. If you find this transition a bit too abrupt, you can soften it using the CSS feature transition. This doesn’t require much effort at all, as shown in the following CSS snippet:
...img { max-height: 100%; min-width: 100%; object-fit: cover; vertical-align: bottom; transition: all 1s ease;}img ...
Read now
Unlock full access