-->

Transparent scrolling navbar


Last final result preview
Live preview

In one case we hold set our baseline code permit's modify our navbar. We testament usage scrolling clear navbar as proven inwards representative earlier than.

1. Exchange current navbar courses inwards header.php:


<nav form="navbar navbar-toggleable-md navbar-dark bg-primary">
with:

<nav form="navbar navbar-toggleable-md navbar-dark fixed-top scrolling-navbar navbar-transparent">

This testament create our navbar clear. You additionally in all likelihood observed that after alter footer began overlap header as beneath:

Baseline code

Don't fret virtually that at present, we testament set up it before long. At present we hold add together ane status to our navbar. Since our carousel with picture testament live seen solely on our place web page, we hold to create certain that our navbar can be clear solely on place web page. In any other case, it testament stay invisible additionally on put up web page the place each navbar in addition to background are white.

2. Exchange navbar-transparent form with next PHP status <?php echo is_front_page() ? "navbar-transparent" : ""; ?>

The finally stair is to regulate our footer

three. Alter navbar in addition to footer colour.

As many of the parts inwards MDB, navbar as good as footer tin can live simply adjusted utilizing MDB Color pellete. Permit's say that we wish our navbar to usage colour secondary-color in addition to our footer to usage colour secondary-color-dark. Merely add together next courses to you navbar in addition to footer correspondingly.


<nav form="navbar secondary-color navbar-toggleable-md navbar-dark fixed-top scrolling-navbar <?php echo is_front_page() ? "navbar-transparent" : ""; ?>">
.
.
.
<footer form="page-footer secondary-color-dark center-on-small-only">
Baseline code

Notation: inwards monastic order to reckon navbar altering colour from clear, you hold to add together some dummy content material within index.php betwixt <?php get_header(); ?> in addition to <?php get_footer(); ?> . You tin can usage a number of <br> tags or whatsoever different content material to create your web site lengthy plenty for scrolling.

For the sake of this tutorial I testament live utilizing primary-color-dark for each - navbar in addition to footer.

At present when are prepared with our clear navbar we tin can displace on to implementation of the carousel


If one thing doesn’t piece of work as anticipated, you tin can obtain a last code for this lesson hither:

Previous Lesson Download Live preview Next lesson
Supply: Here