How to add a sticky fixed bootstrap 4 navigation to your website design

This lesson is exclusive to members

Course contents
SECTION: 4
Project 2: Bike Repair Website 6:12:48
SECTION: 6
Project 4: Bootstrap Yogurt Website 3:35:39

Questions

You need to be a member to view comments.

Join today. Cancel any time.

Sign Up

Course info

128 lessons / 17 hours 5 projects Certificate of achievement

Overview

Hi there, my name is Daniel Scott and together we’re going to learn how to build professional responsive websites. which look good on mobiles, tablets and desktop screens.

We will build 4 sites together...
  • a simple but elegant restaurant website.
  • a bike repair website. 
  • a responsive portfolio website.
  • a Bootstrap website.  

We cover everything you need to build your first website. From creating your first page through to uploading your website to the internet. We’ll use the world’s most popular (and free) web design tool called Visual Studio Code.

There are exercise files you can download and then work along with me. At the end of each video I have a downloadable version of where we are in the process so that you can compare your project with mine. This will enable you to see easily where you might have a problem.

We will delve into all the good stuff such as how to create your very own mobile burger menu from scratch learning some basic JavaScript and jQuery. 

 You will...
  • Learn how to work with responsive images and icons. and stunning full screen background images and probably one too many gradients. 
  • Learn how to create forms and to choose great fonts for your website. 
  • Learn how to work with Bootstrap 4 to easily add carousels, cards and complex looking menus. 
  • Setup a domain name with hosting so that your website is live on the internet for others to see.  

There are fun class projects for you to work on which will enable you to practice what you learn. By the end of this course you’ll have a great understanding of important web design topics like HTML5, CSS3, Flex box, Responsive design and Bootstrap.   

If that all sounds a little too fancy - don’t worry, this course is aimed at people new to web design and who have never coded before. We’ll start right at the beginning and work our way through step by step. 

Who am I? 

I’m Dan, and I’ve been building websites for about 15 years now. I am award winning instructor, and have won a MAX Master award for the last 2 years in a row at the prestigious Adobe Max conference.

Time to upgrade yourself?
Sign up for the course and let’s learn how to build responsive websites.

Course duration 16 hours 42 mins
Daniel Scott

Daniel Scott

Founder of Bring Your Own Laptop & Chief Instructor

instructor

I discovered the world of design as an art student when I stumbled upon a lab full of green & blue iMac G3’s. My initial curiosity around using the computer to create ‘art’ developed into a full-blown passion, eventually leading me to become a digital designer and founder of Bring Your Own Laptop.

Sharing and teaching are a huge part of who I am. As a certified Adobe instructor, I've had the honor of winning multiple Adobe teaching awards at their annual MAX conference. I see Bring Your Own Laptop as the supportive community I wished for when I was first starting out and intimidated by design. Through teaching, I hope to bring others along for the ride and empower my students to bring their stories, labors of love, and art into the world.
True to my Kiwi roots, I've lived in many places, and currently, I reside in Ireland with my wife and kids.

Certificates

We’re awarding certificates for this course!

Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.

Downloads & Exercise files

Download Exercise Files Download Completed Files

Transcript

Hi there, in this video we're going to get our Navigation to be sticky. So when we scroll it still stays at the top, and also we'll fix our little problem where we're on mobile, and it's over on this left-hand side here. We're going to move it so it lines up nicely on the right. 

Remember, earlier in the course we went and fixed our Header to the top. We made a Class that said, Position Fixed on the Nav, and that will work, but there are some fancy stuff that Bootstrap have got. Finding it is always the fun part, you're like, "All right, so where's your fixed Heading?" Position Fixed looks good. This one here, Navbar fixed, look at that, let's click on this one. You end up at this Examples page, and you're like, "Ah, it's not quite what I wanted."

Go back to 'Documentation', let's look up 'Fixed' again. And this is the, I don't know, I guess I want to make sure, that when you are doing yourself, you're like, "Am I doing this right? You're like, "Yep." Is just working out what Bootstrap have done. Fixed Top, you're like, "Perfect." Just add that to the Div. Which Div? Probably the first one, this kind of wraps everything up. My Navigation, let's add it here. Paste it, you're like, "Bingo, job done." Kind of works, it's fixed to the top, but it's broken my navigation. 

So probably Bootstrap, being great. They've got something else. Sticky is the word, so let's have a look.. So Sticky Position, Sticky Top, it's actually just underneath where we were. There's Fixed Top, and just a little bit below is Sticky Top. So here we go, 'Copy', and let's try Sticky Top instead of Fixed Top. Let's give that a whirl. Ah, there we go. You decide whether you like our Fixed Top, especially because it's see-through, and kind of covering things, up to you, but that is how you fix a Top Navigation in Bootstrap4. 

The last thing I want to do before we go is, this has been annoying me. There's this drop-down, and it appears all the way over here on the left, and you're like, "Why is that, have I broken it?" I was looking at it, I was like, "Did I break that?" Then I had to look back at our old, when we just got it first installed, and got it started. Let's inspect this one. Actually, it's a default from Bootstrap. So this is how it came out of the box. You can see, it just kind of pushes it over here, with some background color, which we removed. 

So that's the default. How to fix it? I spent a good chunk trying to fix that. I tried to work out, I tried to use Margin, because we did Margin Left, remember, we overrode that to make it go all the way this side, but turns out it only works for, remember, we did it here, we said, on the UL, where are you, UL? Drop-down menu, we said it was on Margin, was on right, and means that it looked like this. 

Remember, it was kind of jammed up against this side. So we just did that, and you'd assume it would have fixed the buttons as well, but nope, they still appear, when it's down on Mobile, all the way over here. I tried a couple of things, I tried Text Left, I tried applying the ML Auto to a couple of different items in here. Still couldn't work it out, eventually I found this. 

So there is an option to float items, we looked at, Float is kind of like an old, not old-school, but a different way of aligning left and right. So I'm going to do 'Float', and I'm going to have a look under, where is it? It's under 'Utilities', under 'Float'. So you can kind of see, Float Left, Float Right, Float None. And it kind of moves them left or right. You can do it for different Media Queries. So I want it to float to the right, please. Let's give this a go, and let's put it in our code. 

Where does it go? Very good point. Let's have a little look at inspecting inside of Chrome. So let's pop this down, let's use this little option to inspect the element, and we're looking for, like the Container. We don't want the actual buttons themselves. We're kind of just moving our mouse around, till we find something that feels like the Container. I'm going to click on it, then down here I'm just going to stick it to this and see what goes. 

So the same UL, so where is it? The UL Class. We're going to add this as well, and see how that goes. Drop-down, hey, nice. It's been pushed down a bit too far, my Logo's too big. I need to make that smaller, so this Nav has got this big gap between here, but that's something I can let you fix. Make the Logo smaller. All right, Drop-downs work, everything works. It's lovely. All right, on to the next video.
  • Powered by Marvin
  • Terms of use
  • Privacy policy
  • © Bring your Own Laptop Ltd 2024