Change the width and height of element using CSS

CSSWeb DevelopmentFront End Technology

Use the scale() method to change the width and height of the element with CSS.

Let us see the syntax −

scale(x,y);

Here, x is a number representing the abscissa of the scaling vector.

y is a number representing the ordinate of the scaling vector.

Let us see an example −

div {
   width: 40px;
   height: 50px;
   background-color: black;
}
   .myScaled {
   transform: scale(0.4);
   background-color: orange;
}
raja
Updated on 21-Jun-2020 05:04:52

Advertisements