Computer >> Computer tutorials >  >> Programming >> CSS

The CSS3 scale3d() Function


The scale3d() function is used to scale an element in 3D space. The element is scaled based on numbers set as parameter.

Example

<!DOCTYPE html>
<html>
<head>
<style>
.scale3d_img {
   transform: scale3d(0.5, 1, 1.7);
}
</style>
</head>
<body>
<h1>Learn</h1>
<p>Learn Apache Spark</p>
<img class="scale3d_img" src=
"https://www.tutorialspoint.com/apache_spark/images/apache-spark-mini-logo.jpg"
alt="Apache Spark">
</body>
</html>

Output

The CSS3 scale3d() Function

Example

Let us now see another example −

<!DOCTYPE html>
<html>
<head>
<style>
.scale3d_img {
   transform: scale3d(-1.4, 0.4, 0.7);
}
</style>
</head>
<body>
<h1>Learn</h1>
<p>Learn Apache Spark</p>
<img class="scale3d_img" src=
"https://www.tutorialspoint.com/apache_spark/images/apache-spark-mini-logo.jpg"
alt="Apache Spark">
</body>
</html>

Output

The CSS3 scale3d() Function