Open In App
Related Articles

Tailwind CSS Border Opacity

Improve Article
Improve
Save Article
Save
Like Article
Like

This class accepts lots of value in tailwind CSS in which all the properties are covered in class form. The border-opacity is the class of an element that describes the transparency of the element. It is the alternative to the CSS Opacity / Transparency.

Border Opacity class:

  • border-opacity-0
  • border-opacity-5
  • border-opacity-10
  • border-opacity-20
  • border-opacity-25
  • border-opacity-30
  • border-opacity-40
  • border-opacity-50
  • border-opacity-60
  • border-opacity-70
  • border-opacity-75
  • border-opacity-80
  • border-opacity-90
  • border-opacity-95
  • border-opacity-100

Syntax:

<element class="border-opacity-{amount}">...</element>

Example:

HTML




<!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 Border Opacity Class</b>
      
    <div class="mx-14 bg-green-200 grid grid-rows-4 
                grid-flow-col gap-2 text-justify p-4">
  
        <p class="border-green-800 border-4
                border-opacity-100 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-green-800 border-4
                border-opacity-75 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-green-800 border-4
                border-opacity-50 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-green-800 border-4
                border-opacity-25 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-yellow-800 border-4
                border-opacity-100 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-yellow-800 border-4
                border-opacity-75 p-2">
            A Computer Science Portal for Geeks
        </p>
  
  
        <p class="border-yellow-800 border-4
                border-opacity-50 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-yellow-800 border-4
                border-opacity-25 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-pink-800 border-4
                border-opacity-100 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-pink-800 border-4
                border-opacity-75 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-pink-800 border-4
                border-opacity-50 p-2">
            A Computer Science Portal for Geeks
        </p>
  
        <p class="border-pink-800 border-4
                border-opacity-25 p-2">
            A Computer Science Portal for Geeks
        </p>
    </div>
</body>
  
</html>


Output:


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 23 Mar, 2022
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials