1/*Zoom on hover*/
2
3<style>
4.zoom {
5 padding: 50px;
6 background-color: green;
7 transition: transform .2s; /* Animation */
8 width: 200px;
9 height: 200px;
10 margin: 0 auto;
11}
12
13.zoom:hover {
14 transform: scale(1.5); /* (150% zoom)*/
15}
16</style>
17
18<div class="zoom"></div>
19
20/*credits: w3schools.com */
1.child::before {
2 content: "";
3 display: none;
4 height: 100%;
5 width: 100%;
6 position: absolute;
7 top: 0;
8 left: 0;
9 background-color: rgba(52, 73, 94, 0.75);
10}
11
12.parent:hover .child:before,
13.parent:focus .child:before {
14 display: block;
15}