Skip to content
Related Articles
Open in App
Not now

Related Articles

CSS | scaleZ() Function

Improve Article
Save Article
  • Last Updated : 19 Aug, 2022
Improve Article
Save Article

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




<!DOCTYPE html>
<html>
 
<head>
    <title>CSS scaleZ() function</title>
 
    <style>
        body {
            text-align:center;
        }
        h1 {
            color:green;
        }
        .scaleZ_image {
            transform: perspective(500px) scaleZ(3) rotateX(45deg);
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>CSS scaleZ() function</h2>
 
    <img class="scaleZ_image" src=
        alt="GeeksforGeeks logo">
</body>
 
</html>

Output:

  

Example 2: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>CSS scaleZ() function</title>
 
    <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>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>CSS scaleZ() function</h2>
 
    <div class="GFG">Welcome to GeeksforGeeks</div>
</body>
</html>

Output:

  

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

  • Google Chrome 12
  • Edge 12
  • Internet Explorer 10
  • Firefox 10
  • Safari 4
  • Opera 15

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!