In this example, we will learn how to make an element bigger on hover using CSS. We will be using the transform
property of CSS to transform the element.
.example{
padding: 10px;
background-color: aquamarine;
cursor: pointer;
}
.example:hover{
transform: scale(1.5);
}
Output
In this example, we learned how to make an element bigger on hover using CSS. Here, we used the transform
property with its value set to scale(1.5)
to grow the element 1.5
times when the mouse hovers over the element.