Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
I'm here on the lynda.com blog at www.lynda.com/articles. And one of the navigation elements that the lynda.com blog uses is down here at the very bottom of the web page. So if you scroll all the way down to the bottom of the blog, you'll notice down here in the bottom there is this little link that says Older Entries. This is a very common type of navigation that you see in blogs, so if I click this link that says Older Entries, and I go all the way down to the bottom of the page, again, you'll notice that it now it says Older Entries and Newer Entries.
This type of navigation lets you page basically back and forth between parts of this blog just by clicking these links. We can go back a page in time or go forward a page in time. This is called Pager inside of Bootstrap, so a Pager allows you to style these links for next and previous or older and newer that you see at the bottom of these pages. So if you hop on into Dreamweaver, you'll notice that I've given you some really simple markup, this is just a two-bullet list.
Just a ul with the two bullets that say Previous and Next. Styling this is just as easy, so we're going to start by adding up here on the top a class of pager inside of the ul tag. And that will take care of the styling for our Previous and Next buttons with Bootstraps defaults. If you just go ahead and save that document, and we preview it inside of Firefox, you'll see now that we have two links, Previous and Next, I can roll over them, you can see that they have a very nice hover state as well. So that's great! You may be wondering, what if I want to space these out so that they're at the edges of whatever area I've included these particular buttons in? So, for example, at the bottom of the lynda.com blog we've pushed Older and Newer Entries to the very edges of the blog here.
What if I want to push these two buttons apart as well? Well, that's completely possible. If you hop back into Dreamweaver again, we're going to add two classes. The first li for Previous, we're going to add a class of previous. And for the next button labeled Next, I'm sure it'll be shock to learn we add a class of Next. So just by doing that, this will push these two buttons to the edges of the web page, and Previous would indicate the side where you want it to say older or further back in time, the left side of the page, and the one where it says Next, you want to push to the right side of the page, or going into the future.
So if we Refresh our web page, here we go. Now you see that I've pushed these all the way to the edges of the page. Because I don't have any of the Scaffolding included inside of this HTML document, these are pushed all the way to the edges of the window. Of course, these will be pushed to the edges of its containing element if you had some additional markup here. So if you have these in the bottom of some kind of div, let's say with a span of four, it will be pushed to the edges of that. In other words, about a third of the screen width, instead of the entire screen width, as you see here.
So that's great, but what if there are no previous entries? What if I would like to have that Previous button sort of grayed out? Just as we've seen before in the last video, you can add a class of disabled, disabled will gray this button out. So if you go ahead and Save that one more time, Refresh your web page, you'll see now that the previous button is grayed out, there's no hover state, and the arrow stays when I roll my mouse over it, implying that this is not a clickable button. But just as I pointed out in the previous video, it most assuredly is a clickable button.
And you can combine this with a couple of classes to give this some nice styling and some great functionality.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.