New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Up and Running with Bootstrap 2
Illustration by

Adding a page for next and previous links


From:

Up and Running with Bootstrap 2

with Jen Kramer

Video: Adding a page for next and previous links

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.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Up and Running with Bootstrap 2
2h 38m Beginner Oct 12, 2012

Viewers: in countries Watching now:

Bootstrap is a free web development tool from Twitter that, with a little bit of CSS and JavaScript experience, makes building websites quick, intuitive, and fun. Author Jen Kramer explores its 12-column grid layout; typography and icon libraries; fully functional components like nav bars, buttons, and tabs; and much more. This course also shows how to add JavaScript extras like dropdown menus, modal windows, and photo carousels.

Topics include:
  • 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
  • Making the nav bar responsive with JavaScript
  • Adding dropdown menus to the nav bar, tabs, and pill
Subjects:
Web Responsive Design Web Design Web Development
Software:
Bootstrap
Author:
Jen Kramer

Adding a page for next and previous links

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.

We've used CSS here to make it look like it's not. So if you really truly don't want this button to be clickable, you're going to have to find some way of getting rid of that link or using more JavaScript tricks or using some kind of programming language to make this truly a not clickable button. The next button, of course, still remains clickable. All right, so this is some very simple markup here for including Next and Previous or Older and Newer buttons inside of your web pages. If you want to flip forward a page or back in time, they're very commonly used at the bottom of blog entries.

And you can combine this with a couple of classes to give this some nice styling and some great functionality.

Find answers to the most frequently asked questions about Up and Running with Bootstrap 2.


Expand all | Collapse all
please wait ...
Q: I am trying to create the image carousels shown in this course, and they are not functioning properly. The custom.css file seems to be missing from the exercise files and I think this is the reason. Can you provide it?
A: custom.css isn't created until the carousel indicators are added. However, these styles have to do with the way the indicators look, and nothinghas to do with the way the carousel functions.
 
Are you sure you're working with Bootstrap 2.x? You download that from here: 
http://getbootstrap.com/2.3.2/. The carousel changed radically between Bootstrap 2.x and Bootstrap 3, and this course might not work with version 3.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Up and Running with Bootstrap 2.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.