Click here to Skip to main content
16,020,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I dont know how to achieve that blur effect do not affect my buttons on navigation bar.

What I have tried:

.navbar {
      margin-bottom: 0;
      background-color: #00A1A6;
      z-index: 9999;
      border: 0;
      font-size: 12px !important;
      line-height: 1.42857143 !important;
      letter-spacing: 4px;
      border-radius: 0;
      font-family: Montserrat, sans-serif;
filter: blur(5px);
  }
  .navbar li a, .navbar .navbar-brand {
      color: #fff !important;
  }
  .navbar-nav li a:hover, .navbar-nav li.active a {
      color: #00A1A6 !important;
      background-color: #fff !important;
      
  }
  .navbar-default .navbar-toggle {
      border-color: transparent;
      color: #fff !important;
  }

<pre><nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#myPage">CodeArt</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#about">ABOUT</a></li>
        <li><a href="#services">SERVICES</a></li>
        <li><a href="#portfolio">PORTFOLIO</a></li>
        <li><a href="#pricing">PRICING</a></li>
        <li>  <a href="#contact">CONTACT</a></li>
      </ul>
    </div>
  </div>
</nav>
Posted
Updated 23-May-18 5:14am
Comments
Bohdan Stupak 6-Mar-18 4:11am    
What kind of question is that? If you don't want blur just don't use filter: blur(5px);
Bob@work 18-Dec-18 15:07pm    
You've applied the blur() effect to the outermost container, and everything inside is blurred as a result. I was able to achieve a reasonably close appearance using the box-shadow attribute with a matching color, instead of the blur. However, the edge of the container remains pretty distinct.

navbar {
      margin-bottom: 0;
      background-color: #00A1A6;
      z-index: 9999;
      border:none 1px #000000;
      font-size: 12px !important;
      line-height: 1.42857143 !important;
      letter-spacing: 4px;
      border-radius: 40px;
      font-family: Montserrat, sans-serif;
box-shadow:0px 0px 40px  #00A1A6;
      filter: blur(0px);
  }


Another option is to create a blurred background element, and place the navbar element on top. It looks better, but may not be consistent on all devices and browsers [I don't have time to check today].

style>
div.background {
      margin-bottom: 0;
      background-color: #00A1A6;
      z-index: 9999;
      border:none 1px #00A1A6;
      font-size: 12px !important;
      line-height: 1.42857143 !important;
      letter-spacing: 4px;
      border-radius: 40px;
      font-family: Montserrat, sans-serif;
	  box-shadow:0px 0px 40px  #00A1A6;
filter: blur(10px);
position:fixed;
width:90%;
height:500px;
z-index:-1;

  }
  
 .navbar {
      margin-bottom: 0;
      background-color: transparent;
      z-index: 9999;
      border:none 1px #000000;
      font-size: 12px !important;
      line-height: 1.42857143 !important;
      letter-spacing: 4px;
      border-radius: 40px;
      font-family: Montserrat, sans-serif;
	  box-shadow:0px 0px 0px  #00A1A6;
filter: blur(0px);
position:fixed;
width:90%;
height:500px;


  }
  .navbar li a, .navbar .navbar-brand {
      color: #fed !important;
	  filter: blur(0px);
  }
  .navbar-nav li a:hover, .navbar-nav li.active a {
      color: #00A1A6 !important;
      background-color: #fff !important;
	  filter: blur(0px);
      
  }
  .navbar-default .navbar-toggle {
      border-color: transparent;
      color: #000 !important;
	  filter: blur(0px);
  }
</style>


<div class="background"> </div>
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#myPage">CodeArt</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#about">ABOUT</a></li>
        <li><a href="#services">SERVICES</a></li>
        <li><a href="#portfolio">PORTFOLIO</a></li>
        <li><a href="#pricing">PRICING</a></li>
        <li>  <a href="#contact">CONTACT</a></li>
      </ul>
    </div>
  </div>
</nav>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900