Topic: Fixed Navbar and Transparent Navbar

Vipul Chikara free asked 6 years ago


<header class="h-100">
<mdb-navbarSideClass="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar intro-fixed-nav"[containerInside]="false">
<mdb-navbar-brand>
<aclass="logo navbar-brand"href="#">
<strong>Navbar</strong>
</a>
</mdb-navbar-brand>
<links>
<ulclass="navbar-nav mr-auto">
<liclass="nav-item active waves-light"mdbWavesEffect>
<aclass="nav-link">Home
<spanclass="sr-only">(current)</span>
</a>
</li>
<liclass="nav-item waves-light"mdbWavesEffect>
<aclass="nav-link">Link</a>
</li>
<liclass="nav-item waves-light"mdbWavesEffect>
<aclass="nav-link">Profile</a>
</li>
</ul>
</links>
</mdb-navbar>
<!-- Main -->
<divclass="view intro-2"style="">
<divclass="full-bg-img">
<divclass="mask rgba-purple-light flex-center">
<divclass="container text-center white-text wow fadeInUp">
<h2>This Navbar is fixed and transparent</h2>
<br>
<h5>It will always stay visible on the top, even when you scroll down</h5>
<p>Navbar's background will switch from transparent to solid color while scrolling down</p>
<br>
<p>Full page intro with background image will be always displayed in full screen mode, regardless of device </p>
</div>
</div>
</div>
</div>
<!-- /.Main -->
</header>
<!--Main Navigation-->

<!--Main Layout-->
<main class="text-center py-5">

<divclass="container">
<divclass="row">
<divclass="col-md-12">

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum
dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

</div>
</div>
</div>

</main>
<!--Main Layout-->
 
 
Scss 
 
.view {
background: url("https://mdbootstrap.com/img/Photos/Others/img (40).jpg")no-repeatcentercenter;
background-size: cover;
height: 100vh;
}

.navbar {
background-color: transparent;
}

.top-nav-collapse {
background-color: rgb(10, 10, 10);
}

@media only screen and (max-width: 10px) {
.navbar {
background-color: #4285F4;
}
}

Damian Gemza staff answered 6 years ago


Dear @Vipul Chikara 

I have tested it, but for me, it works fine. When I scroll down the page, the navbar is getting the background-color.

Please copy the styles which you have provided me into styles.scss stylesheet, and try one more time.

Best Regards,

Damian


Vipul Chikara free answered 6 years ago


Dear Sir

When i scroll down the webpage the navbar become fixed but the color to navbar remain transparent i found that .top-nav-collapse and .navbar is not working properly even when i change the color in .navabr the color not change

Please help me out


Damian Gemza staff answered 6 years ago


Dear @Vipul Chikara

Could you please provide me with more informations about your problem? What's wrong?

Best Regards,

Damian



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: Dell
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No