Change the height of element using CSS

Use the scaleY() method to change the height of the element with CSS.

Let us see the syntax −

scaleY(n);

Here, n is a number representing the scaling factor.

Let us see an example −

div {
   width: 40px;
   height: 50px;
   background-color: black;
}
.myScaled {
   transform: scaleY(0.9);
   background-color: orange;
}
Updated on: 2020-06-21T05:05:59+05:30

160 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements