Change the width of element using CSS

CSSWeb DevelopmentFront End Technology

Use the scaleX() method to change the width of an element with CSS.

Let us see the syntax −

scaleX(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: scaleX(0.9);
   background-color: orange;
}
raja
Published on 02-May-2018 16:04:04
Advertisements