0

I want to make my top nav transparent (opacity: 0.9) and I want to make the background behind the top nav sort of blur (like Apple Inc has done here:)

enter image description here

How do I blur the background?

mmaismma
  • 763
  • 6
  • 19

1 Answers1

1

You can use backdrop-filter:

.background {
  background: url(https://picsum.photos/640/240) center/cover;
  width: 600px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

h1 {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 40px 80px;
  color: white;
  
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
<div class="background">
  <h1>Hello World</h1>
</div>

Also check the supportage

Hao Wu
  • 17,573
  • 6
  • 28
  • 60