Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

CSS | scaleZ() Function

  • Last Updated : 08 Aug, 2019

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:






<!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:




<!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
  • Internet Explorer
  • Firefox
  • Safari
  • Opera



My Personal Notes arrow_drop_up
Recommended Articles
Page :