Scaling Elements3:12 with Guil Hernandez
One of the most common CSS transformations is scaling. You can increase or decrease the size of elements using scale functions like scaleX(), scaleY(), and scale().
- To apply a basic scale transformation, define a number that instructs the browser how large to scale an element.
- The default value for
- To make an element twice as large, write
2as the value:
scale()value evenly scales an element both vertically and horizontally.
scale()accepts a second number value inside the parenthesis.
- Two values let you individually scale the horizontal and vertical dimensions; write the scaling value for X first, followed by the scaling value for Y.
- When scaling an image, make sure that the original dimensions of the image is larger than the size at which you're scaling the image.
You need to sign up for Treehouse in order to download course files.Sign up