Dark CSS

CSS Mix Blend Mode with Overlay Effect

Facebook
Twitter
WhatsApp

project demo

html code

				
					<!DOCTYPE html>
<html lang="en">

<head>
  <title>Button Hover Effect</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <div class="container">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>

  <h2 class="text">Difference</h2>
</body>

</html>
				
			

css code

				
					* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.container div {
    width: 100%;
    height: 300px;
    background: #212121;
}

.container div:nth-child(even) {
    background: #fff;
}

.text {
    font-size: 6rem;
    position: fixed;
    mix-blend-mode: difference;
    color: #fff;
    text-transform: uppercase;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    letter-spacing: 2px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}