Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more Web and personalized recommendations.Start Your Free Trial Now
- View Offline
- Understanding the difference between default and fluid grids
- Nesting with fluid grids
- Creating a thumbnail gallery
- Adding block quotes and lists of text
- Incorporating images and icons
- Adding breadcrumb navigation and pagination
- Using tabs and pills navigation
- Adding dropdown menus to the nav bar, tabs, and pill
Skill Level Beginner
Over the next few videos, we're going to take a look at the simple bulleted list here and a number of different ways that we can change the classes to make this list look very, very different inside of Bootstrap. So, right now I'm taking a look at pills here. We're going to take a look at pills and tabs. Tabs you're probably familiar with, and pills are sort of round, oval sort of shapes. They have curved edges that you can also use to make very interesting looking navigation bars. What we have right now is our default markup, though, isn't terribly interesting.
If I very quickly look at this inside of Firefox, you'll see that what you got is your basic bulleted list, very functional, not terribly pretty. So let's start adding some classes to see how we can make this look a little bit more attractive or a little bit different. So inside of Dreamweaver, the very first step is to add a class of nav. This is the most basic markup. Just by adding this nav you've indicated that this is navigation and some basic things are going to happen here.
So when I refresh you'll see that the margin and padding associated with ul has gone away, you'll see that the bullets have gone away, and we're now crammed into the side of the web page. The reason we're crammed into the side of the web page is because I'm not making use of the Bootstrap's Scaffolding system at this point. I've kept my markup very, very simple, the nav tag is located inside of the body tag, it's being pushed all the way out to the very edges of the web page. If I had this nav tag located somewhere else inside of the Bootstrap Scaffolding, this navigation would not look like it's a crammed into the edge.
So as you roll your mouse over these, you can see that there's a nice hover state that goes down these quite lovely. The reason that that hover state goes all the way across the page is because that's how wide the containing element for these particular links is. If you use the Scaffolding system, of course, this could be potentially quite narrower, depending on which of the span classes you choose to put your navigation list in. All right, so that's it, very, very basic, the first step of styling. Now let's add something to make it a little bit more interesting.
If I add nav-tabs, this will of course create more of a very tabbed type of look. It'll make our links go horizontal instead of vertical as well. So if I Refresh my page in Firefox, you'll see that that has in fact happened. We have a series of links here with a line underneath, and everything is looking great, but it doesn't really look like tabs yet. And the reason it doesn't look like tabs is because I haven't indicated what page I'm on. What page is the active page? There is that active class again, so let's say I'm on The Art page, so if I put in a class of active right here inside of my li and save that one more time and put that in Firefox, you'll see that we have a very nice looking tab right here. Of course, I can put some content underneath of this, and then it would be really obvious where I was.
So, that is tabs, and they're most simple structure. Make sure that you have an active state so that the tab meme is a little bit more obvious on the page. Now you might be wondering what else could you do with this type of tab styling? There is another class that makes things go vertical. So what would happen if we took this tab styling, and we actually made it go vertical? Well, it's a little bit surprising. So after nav tabs, if you add nav-stacked and save that page one more time, Refresh in Firefox, you'll see that we have a very nice stack of links. Instead, it's a definite step up from what we had with just the nav class on that ul.
We have a bit more margin, a bit more padding, we have some nice borders going on between these, we have a great hover state, we still have our active state right here, it looks like it's grayed out, it looks like you can't click on it, even though you can. Remember, that's just a trick that the CSS is playing on you. I've discussed that in the previous two videos, and of course, these links continue to look like they go all the way across the page because there's no Scaffolding in place. Hide scaffolding, then you would see these look a bit narrower. So, what about that pill thing that I mentioned before? Well, if I go back here into Dreamweaver, I'm going to take out nav-stacked, and I'm going to change nav-tabs to nav-pills, and if you Save that and Refresh your Firefox web page, you'll see that the navigation has again gone horizontal and the active page that we were on has this lovely blue pill surrounding it, in this case, a blue box with rounded corners, and of course, there is a very nice hover state here as well.
As I hover over these links, you'll see that they have a lovely grayed box also with rounded corners. You could use custom CSS to change these colors or tweak the way that these are styled. Just like we saw with the tabs, you can make this pilled structure also go vertical, and if we hop back in the Dreamweaver again and add nav-stacked just the same way we did with the tabs and save and look at this in Firefox again, you'll see that now our navigation has gone horizontal. We still have our current page clearly marked here with these big blue rounded cornerbacks, and we still have our hover state in place as well.
This is an introduction to tabs and pills and how we can work with them to give us at least three or four different unique looks for how our navigation could look on a web page just with a handful of styles using the Bootstrap framework.