Open In App

Tailwind CSS Transform

Improve
Improve
Like Article
Like
Save
Share
Report

This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. This class is used to control the transform behavior of any element. In CSS, we can do that by using the CSS transform property.

Transform Classes:

  • transform: To perform any transformation you have to use this class.
  • transform-gpu: By using this class the transformation will be executed on GPU on CPU that will perform in a more soothing way.
  • transform-none: This class is used to deactivate the transformation effect.

Syntax:

<element class="transform-{trans-on}">...</element>

Example:

HTML




<!DOCTYPE html> 
<html
<head
    <link href
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
    rel="stylesheet"
</head
  
<body class="text-center"
    <h1 class="text-green-600 text-5xl font-bold"
       GeeksforGeeks 
    </h1
    <b>Tailwind CSS Transform Class</b
    <div class="bg-green-300 
                mx-16 
                space-y-4 
                p-2 
                justify-between 
                grid grid-rows-1 
                grid-flow-col"> 
      
    <div title="bg-left-top"
        class="bg-no-repeat
               w-16 h-16
               my-4 transform skew-y-12" 
        style= 
        "background-image:url( 
    </div
    <div title="bg-left"
        class="bg-no-repeat 
               w-16 h-16
               my-4 transform rotate-45" 
        style= 
        "background-image:url( 
    </div
    <div title="bg-left-bottom"
        class="bg-no-repeat 
               w-16 h-16 
               my-4 transform scale-50" 
        style="background-image:url( 
    </div
    <div title="bg-left-bottom"
        class="bg-no-repeat 
               w-16 h-16 
               my-4 transform translate-x-4 translate-y-4" 
        style="background-image:url( 
    </div>
    </div
</body
</html>


Output:

Tailwind CSS transform class



Last Updated : 23 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads