mardi 3 août 2021

Blur effect doesn't cover the entire element (navbar)

I would like to create a blur effect on the navbar on my website but the blur effect doesn't cover the entire navbar even if I use background-size: cover Instead of a clean blur effect, it seems that the effect has an oval shape.

Thanks in advance

Pic of the actual result

Here is my Html Code:

  <div class="navbar">
    <li><a href="#">Home</a></li>
    <li><a>Study</a></li>
    <li><a>Skills</a></li>
    <li><a href="#caroussel">Photographs</a></li>
  </div>

And the css code:

.navbar{
  text-align: right;
  overflow: hidden;
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0,0,0, 0.5);
  backdrop-filter: blur(20px);
  z-index: 9999;
  
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.logo{
  position: absolute;
  left: 5%;
  margin-top: 3px;
  height: 45px;
  width: auto;
  float: left;
}

.navbar a{
  display: block;
  list-style: none;
  border-bottom: 3px solid rgba(0, 0, 0, 0);
}



.navbar li a:link,
.navbar li a:visited{
  color: #cccccc;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 90%;
  transition: border-bottom 0.2s;
  padding-bottom: 5px;
}

.navbar li {
  display: inline-block;
  margin-top: 20px;
  padding-bottom: 5px;
  margin-right: 40px;
}

.navbar li:last-child{
  padding-right: 5%;
}

.navbar li a:hover,
.navbar li a:active{
  border-bottom: 3px solid #cf6d17;
}

Aucun commentaire:

Enregistrer un commentaire