Previous Lesson: Lesson 37: Album Template From Bootstrap
In this lesson, we’re gonna be beautifying the NavBar by changing each button to the appropriate labels that we want, one step at a time.
Yes, we don’t want our NavBar to look like this at all:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.07.08-PM-1024x640.png)
Because as you can remember, we want to have something like this:
![](https://zeddrix.com/wp-content/uploads/2020/03/portfolio-project-sketch-6.jpg)
And the code for the current NavBar can be found on these selected lines:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.11.23-PM-1024x640.png)
As you may have noticed, especially if you already have an experience in HTML, the NavBar here is in our header block. Let’s DELETE all these (just the selected lines after the opening header tag down to the closing header tag):
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.17.43-PM-1024x640.png)
Good. Make sure that your code looks exactly like this. And then, let’s go to getbootstrap.com:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.18.38-PM-1024x640.png)
Go to the Documentation:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.18.49-PM-1024x640.png)
Then search NavBar:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.19.04-PM-1024x640.png)
Click on the NavBar/NavBar and it will take you here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.19.25-PM-1024x640.png)
Okay. Scroll down ’till you see this:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.21.17-PM-1024x640.png)
But we’ll NOT use this one here. Instead, we’ll use this shorter and simpler one:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.20.35-PM-1024x640.png)
Copy this code (do you see that little Copy located at the top-right?):
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.23.25-PM-1024x640.png)
Click on it:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.23.37-PM-1024x640.png)
And then we’ll paste this on this line:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.24.13-PM-1024x640.png)
Command + V or Ctrl + V:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.24.43-PM-1024x640.png)
Nice. Make sure that your code looks exactly and looks uniformed like this. Finally, let’s have a look at our website (not refreshed yet):
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.26.44-PM-1024x640.png)
Refresh:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-15-at-1.27.30-PM-1024x640.png)
What a difference! Now, check this out:
The NavBar becomes a hamburger button–so cool!
Light vs Dark NavBar
Do you want a dark-colored NavBar? Well, we can do something about that. But let’s first commit this change:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.24.25-PM-1024x640.png)
Okay. Now about that dark-colored NavBar, we can change that here on the bg-light:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.25.27-PM-1024x640.png)
The bg means “background”; of course, light means light or white color. We can just select the light and change it to dark like this:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.26.56-PM-1024x640.png)
Let’s see what happens when we refresh:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.29.04-PM-2-1024x640.png)
Woah! That’s ugly–we can’t even see anything on our NavBar! We can do something about that here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.38.07-PM-1024x640.png)
Let’s change light to dark:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.38.20-PM-1024x640.png)
Refresh:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-12.38.50-PM-1024x640.png)
Now that’s better. Remember, it’s up to you if you want to have a dark or a light NavBar. But, you know, we don’t want that Home, Features, Pricing, and Disabled there.
Zedd Fabian/About/Facebook/Blog
We’ll answer these questions by implementing them in our code:
- How will I change every button to the appropriate label that I want?
- How will I get rid of that Disabled since I only need three buttons?
- All the buttons are at the left side of our NavBar. How do I place all of them at the right side? Because I want my NavBar to look like this:
![](https://zeddrix.com/wp-content/uploads/2020/03/portfolio-project-sketch-7.jpg)
Okay. Let’s start with changing that NavBar to Zedd Fabian (this should be your name of course).
Zedd Fabian
All we have to do is to find the word NavBar:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.31.39-PM-1024x640.png)
Yup, that’s that. Now, let’s change it:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.32.30-PM-1024x640.png)
Remember, this should be your name, not mine. Then, let’s go to our website:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.32.58-PM-1024x640.png)
And refresh:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.33.20-PM-1024x640.png)
Nice, we now have our name here. Now, let’s move those buttons to the right-hand side of the NavBar.
Buttons to the Right Side
On this navbar-nav on Line 54:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.36.59-PM-1024x640.png)
We’ll simply add ml-auto like this:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.37.37-PM-1024x641.png)
Let’s see what this does, from here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.42.19-PM-1024x640.png)
To here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-16-at-1.42.25-PM-1024x640.png)
Cool! You should check out that documentation that I’ve linked on the ml-auto to learn more about it. Now let’s change the menu buttons into the appropriate names that we want.
About
Let’s start with the About button. Select this first since we don’t need it:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.32.04-AM-1024x640.png)
DELETE:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.32.24-AM-1024x640.png)
Then let’s change Home:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.32.55-AM-1024x640.png)
To About like this:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.33.09-AM-1024x640.png)
Good. Let’s see:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.34.10-AM-1024x641.png)
Cool. You know, I think we should delete this active here for our About button:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.34.38-AM-1024x640.png)
So our code should look like this once we’ve done that:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.34.49-AM-1024x640.png)
Let’s see:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.35.54-AM-1024x642.png)
Good. We’re just gonna use active when we are already on that button’s or link’s page. For example, when we click on the About page, this should take us to another page with the About button now activated. Therefore, this will indicate that we are currently on a certain page.
Okay, let’s move on to Facebook.
We’ll just select the Features here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.39.26-AM-1024x640.png)
And then change it to Facebook:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.39.33-AM-1024x640.png)
Done. Now let’s see:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.40.15-AM-1024x640.png)
Nice. Now, to the Blog menu!
Blog
That would be the one right here:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.41.36-AM-1024x640.png)
Change it to Blog:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.41.54-AM-1024x640.png)
Let’s see:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.42.15-AM-1024x640.png)
Good. Now, let’s remove that Disabled button since we don’t need that anyways:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.42.55-AM-1024x640.png)
DELETE:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.43.09-AM-1024x640.png)
Let’s see:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-6.43.25-AM-1024x640.png)
Nice! Now that’s pleasing to the eyes. Have you tried clicking on these buttons? If you did, it will not take you anywhere:
Don’t worry, we’re gonna take care of that later on. Let’s do a Git Commit first:
![](https://zeddrix.com/wp-content/uploads/2020/03/Screen-Shot-2020-03-17-at-7.02.39-AM-1024x640.png)
On the next lesson, we’ll fix the greetings first, and then those two buttons there. See ya!