CSS scaleZ() Function (original) (raw)

Last Updated : 07 Jun, 2023

The scaleZ() function is an inbuilt function which is used to resize an element along the z-axis.

Syntax:

scaleZ( z )

Parameters: This function accepts single parameter z which holds the scaling factor along z-axis.

Below examples illustrate the scaleZ() function in CSS:

Example 1:

html `

CSS scaleZ() function
<style> 
    body {
        text-align:center;
    }
    h1 {
        color:green;
    }
    .scaleZ_image {
        transform: perspective(500px) scaleZ(3) rotateX(45deg);
    }
</style> 

GeeksforGeeks

CSS scaleZ() function

<img class="scaleZ_image" src= 

"https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190710102234/download3.png" alt="GeeksforGeeks logo">

`

Output:

Example 2:

html `

CSS scaleZ() function
<style> 
    body {
        text-align:center;
    }
    h1 {
        color:green;
    }
    .GFG {
        font-size:35px;
        font-weight:bold;
        color:green;
        transform: perspective(300px) scaleZ(3) rotateX(45deg);
    }
</style> 

GeeksforGeeks

CSS scaleZ() function

<div class="GFG">Welcome to GeeksforGeeks</div> 

`

Output:

Supported Browsers: The browsers supported by scaleZ() function are listed below:

Similar Reads