Tailwind CSS Backdrop Sepia

Class backdrop-sepia là một class dựng sẵn. Nó dùng để áp dụng bộ lọc sepia cho hình ảnh. Tính năng brightness mới được thêm vào Tailwind CSS ở phiên bản 2.1.

Backdrop Sepia:

  • backdrop-sepia-0: Class này dùng để hiển thị ảnh gốc.
  • backdrop-sepia: Class này dùng để hiển thị ảnh đã được chuyển sang màu sepia.

Cú pháp:

<element class="filter backdrop-sepia |
    backdrop-sepia-0">
</element>

Ví dụ:

HTML
<!DOCTYPE html>
<html>
  
<head>
    <link href=
"https://unpkg.com/tailwindcss@^2.1/dist/tailwind.min.css"
    rel="stylesheet">
</head>

<body class="text-center mx-4 ">
  <h1 class="text-green-600 text-5xl font-bold">
      GeeksforGeeks
  </h1>
  
  <b>Tailwind CSS Backdrop Sepia Class</b>
  
  <div class=" mx-16 mt-18 h-36 relative">
    <div class="absolute w-full py-18">
      <img class="rounded-lg object-cover" src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210605213323/Screenshot20210605213311.png" 
        alt="image">
    </div>
    
    <div class="relative h-32 flex overflow-x-auto space-x-4">
        <div class="flex-shrink-0 border-4 border-green-500 
             backdrop-filter backdrop-sepia-0 w-1/2">
        </div>
      
        <div class="flex-shrink-0 border-4 border-green-500 
             backdrop-filter backdrop-sepia w-1/2">
        </div>
    </div>
    
  </div>
</body>

</html>


Đầu ra:

tailwind-css-backdrop-sepia
Last Updated : 20/07/2025