DEV Community

Saba beigi
Saba beigi

Posted on

Text Portrait

<div class="wrapper">
  <div class="portrait">

  </div
</div>
Enter fullscreen mode Exit fullscreen mode
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.wrapper {
  height: 100vh;
  background: #000;
  /*This part is important for centering*/
  display: grid;
  place-items: center;
}

.portrait {
  font-size: 10px;
  line-height: 10px;
  background: url('https://markodenic.com/wp-content/themes/blog/images/marko.png') fixed center no-repeat;
  background-size: contain;
}

/* This part is important for the feature itself */
.portrait {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: rgba(255,255,255,.1);
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)