x ai css background-blend-mode 2026-06-09

ai generated

background-blend-mode

Blends multiple backgrounds or background with content.

.JMQWk {
 background-image:
  linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
  url("photo.jpg");

 /* common: multiply, overlay, screen, etc. */
 background-blend-mode: multiply;
}

6. Complete Practical Example

<!DOCTYPE html>
<html>
<head>
<style>.hero {
 height: 100vh;

 background:
  linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
  url("file:///C:/Users/xah/web/xahlee_org/xa/xamsi_calku/pink-mouthed_murex/pink-mouthed_murex_71m.jpg") center/cover no-repeat fixed;
 display: flex;
 align-items: center;
 justify-content: center;
 color: white;
 text-align: center;
}</style>
</head>
<body>
  <div class="hero">
    <h1>Beautiful Backgrounds with CSS</h1>
  </div>
</body>
</html>

7. Best Practices & Tips

/* Good pattern */
background-color: #111;                    /* fallback */
background-image:
  linear-gradient(...),
  url("image.webp");
background-size: cover;
background-position: center;