Typography · 27 of 33

Mirror Reflection

Text with a fading floor reflection

HTML · CSS · No dependencies · MIT

HTML

<div class="mirror-wrapper">
  <h2 class="mirror-text">Reflection</h2>
  <h2 class="mirror-reflection" aria-hidden="true">Reflection</h2>
</div>

CSS

.mirror-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 500px;
}

.mirror-text,
.mirror-reflection {
  font-size: 3.5rem;
  font-weight: 600;
  margin: 0;
}

.mirror-reflection {
  transform: rotateX(180deg);
  opacity: 0.3;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: -10px;
  filter: blur(1px);
}