Open In App

Tailwind CSS Fill

This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. This class is a presentation attribute used to set the color of an SVG shape. In CSS, we have done that by using the CSS fill property.

FIll class:



Syntax:

<svg class="fill-current">...</svg>

Example:






<!DOCTYPE html> 
<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 Fill Class</b
    <div class="bg-green-200 m-4 grid grid-flow-col gap-4 p-5"
        <svg height="150px" width="600px"
          xmlns="http://www.w3.org/2000/svg"
          version="1.1"
         <circle class="fill-current text-red-600" cx="100"
                cy="100" r="50" /> 
         <circle class="fill-current text-green-600" cx="250"
                cy="100" r="50" /> 
          <circle class="fill-current text-blue-600" cx="400"
                cy="100" r="50" /> 
          <circle class="fill-current text-yellow-600" cx="550"
                cy="100" r="50" /> 
         </svg
    </div
</body
  
</html

Output:


Article Tags :