Open In App

Tailwind CSS Background Clip

This class accepts more than one value in tailwind CSS in which all the properties are covered in class form. It is the alternative to the CSS background-clip property. This property is used to define how to extend background (color or image) within an element.

Background Clip Classes:



Syntax:

<element class="bg-clip-{Clip type}">...</element>

Example:






<!DOCTYPE html> 
<head
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" 
          rel="stylesheet"
</head
  
<body class="text-center mx-4 space-y-2"
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1
    <b>Tailwind CSS 
    <span class="bg-clip-text text-lg text-transparent 
                 bg-gradient-to-r
                 from-green-400 to-blue-500">
        Background Clip Class
        </span>
    </b
    <div class="mx-2 grid grid-cols-3 gap-2 bg-green-200 rounded-lg">
        <div class="bg-clip-border p-6 bg-green-600 border-dashed
                    border-4 border-green-300">
        </div>
        <div class="bg-clip-padding p-6 bg-green-600 border-dashed
                    border-4 border-green-300">
              
        </div>
        <div class="bg-clip-content p-6 bg-green-600 border-dashed
                    border-4 border-green-300">
              
        </div>
    </div>
</body
  
</html

Output:


Article Tags :