×

Tailwind CSS Fill

The CSS Fill class accepts a lot of value, and all of the properties are covered in class form. It is a presentation attribute that controls how an SVG shape's color is shown. We did this in CSS by using the CSS fill property.

Fill Classes

fill-current: This class is used to make an SVG's fill color the same as the text color. Combining this class with an existing text color utility makes it simple to set an element's fill color.

Syntax is:

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

Example

Example is as follows:

<!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-red-600 text-5xl font-bold">
        Tutorial and Example
    </h1>
    <b>Fill Class - Tailwind CSS </b>
    <div class="bg-red-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-pink-600" cx="100"
                cy="100" r="50" />
         <circle class="fill-current text-red-600" cx="250"
                cy="100" r="50" />
          <circle class="fill-current text-yellow-600" cx="400"
                cy="100" r="50" />
          <circle class="fill-current text-blue-600" cx="550"
                cy="100" r="50" />
         </svg>
    </div>
</body>
</html>

Output:

Tailwind CSS Fill

Related Topics

Tailwind CSS Box Sizing

Tailwind CSS Box sizing class acknowledges more than one worth in tailwind CSS. Each property is shrouded as a class structure. It is an option in contrast to the CSS...

2 minutes read.

Tailwind CSS Flex

CSS flexbox is an important component for frontend development. There are four flex options in Tailwind CSS, and all of the attributes are covered in class form. It's a front-end...

6 minutes read.

Tailwind CSS Grid Auto Flow

In tailwind CSS, this class accepts multiple values, and all of the properties are covered in class form. It is a CSS alternative. The grid-auto-flow property is used in Tailwind...

4 minutes read.

Tailwind CSS Installation

Here, we will discuss the installation method of Tailwind CSS using two strategies discussed as follows: Strategy 1: Install Tailwind through npm Step 1: npm init - y Step 2: npm install tailwindcss Step...

2 minutes read.

Tailwind CSS Object Position

It acknowledges more than one value in tailwind CSS. Every one of the properties is covered as in class form. It is the option in contrast to the CSS object-position...

2 minutes read.

Tailwind CSS Max-Width

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS max-width property. This...

3 minutes read.

Tailwind CSS Margin

The margin class accepts a large number of values, and all of the properties are covered in the same way they are in the class form. It's a replacement for...

6 minutes read.

Tailwind CSS Justify Self

The class form goes over the various properties. It's a replacement for the CSS justify-self attribute. This class is used to describe the alignment of content’s position in a CSS...

4 minutes read.

Tailwind CSS Align Content

In Tailwind CSS, this class accepts a wide range of values. It's a replacement for the CSS Align Content feature. This class is used to modify the flex-wrap property's behavior....

5 minutes read.

Tailwind CSS Clear

This class acknowledges more than one worth in tailwind CSS. Every one of the properties is canvassed as in class form. It is an option in contrast to the CSS...

5 minutes read.

Tailwind CSS Object Fit

It acknowledges more than one value in tailwind CSS. Every one of its properties is covered as in class form. It is the option in contrast to the CSS object-fit...

4 minutes read.

Tailwind CSS Grid Row Start / End

In tailwind CSS, this class takes several values. All of the attributes are covered in the form of a class. In CSS, it's an alternative to the grid-row attribute. It's...

4 minutes read.

Tailwind CSS Order

One of the best features of Tailwind CSS is the Order class, which allows us to order flex and grid objects according to our needs. There are several different order...

2 minutes read.

Tailwind CSS Flex Direction

CSS flexbox is an important element for frontend development. CSS has four directions, therefore in tailwind CSS, all of the properties are covered in class form. It's a front-end development...

5 minutes read.

Tailwind CSS Grid Template Rows

In tailwind CSS, this class accepts multiple values and all properties are covered in class form. It's the CSS grid-template-row property's replacement. It is used to set the number of...

2 minutes read.

Tailwind CSS Align Self

This class accepts a wide range of values. It's a replacement for the CSS Align Self attribute. This class is used to control how a flex or grid item is...

4 minutes read.

Tailwind CSS Justify Items

It is a replacement for the CSS justify-items attribute. This class is used to regulate the alignment of grid objects along their inline axis. Justify Item It is classified as: justify-items-auto justify-items-start justify-items-end justify-items-center justify-items-stretch justify-items-auto The justify-items-auto class...

4 minutes read.

Tailwind CSS Container

In Tailwind CSS, a compartment is utilized to fix the maximum width (max-width) of a component to match the min-width of the breakpoint. It comes exceptionally convenient when content must...

2 minutes read.

Tailwind CSS Width

The tailwind CSS width class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Width Property. This...

3 minutes read.

Tailwind CSS Space Between

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Space Between property....

4 minutes read.