Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating a thumbnail gallery

From: Up and Running with Bootstrap 3

Video: Creating a thumbnail gallery

I'm looking at HTML file 03_06. Comes from your Exercise Files folder. Copy it into your Bootstrap folder, display it in the browser. And this is a new page, we haven't done any work to this page before. And what I've got going on here is a dog photo gallery over here on one side of the page, where I have a series of pictures here with text and then over here on the right side of the page I have some contact information which is actually in tabular format. I will be styling the contact information over here in the next video, but in this video what I'd like to do is I'd like to concentrate on this photo gallery which really doesn't look like a photo gallery at the moment, so what I would like to do then is combine the grid system that you already know with a few additional classes and we're going to wind up with a thumbnail gallery which is pretty darn cool if you think about it.

Creating a thumbnail gallery

I'm looking at HTML file 03_06. Comes from your Exercise Files folder. Copy it into your Bootstrap folder, display it in the browser. And this is a new page, we haven't done any work to this page before. And what I've got going on here is a dog photo gallery over here on one side of the page, where I have a series of pictures here with text and then over here on the right side of the page I have some contact information which is actually in tabular format. I will be styling the contact information over here in the next video, but in this video what I'd like to do is I'd like to concentrate on this photo gallery which really doesn't look like a photo gallery at the moment, so what I would like to do then is combine the grid system that you already know with a few additional classes and we're going to wind up with a thumbnail gallery which is pretty darn cool if you think about it.

So I'm going to come on over here to Sublime Text and I'm going to scroll down here to row number two and this is around lines 27, 28. We have a series of images with paragraphs of information here. And so that's where we're going to be working. What I'm going to start with here. Is adding a grid system around these guys. So, around this first picture here then, I'm going to add a div with the class of row. And, then, we're going to go ahead and just indent all this text here.

And down here I'm going to end that row. Then the next thing I want to add is another div here, a div with a class of col-xs-6. So I'm going to go ahead and use my extra small grid system. And I'm going to wrap this unit around the image and the paragraph. Slash div. And indent once again, the image in the paragraph, to make everything line up here. So I'm going to repeat this process, this div with a class of call extra small 6.

And then we're going to indent image in the paragraph, and we're going to say slash div, and so forth. We're just going to repeat this a few times. So that every single one of these guys is going to have this div around it. And since we've got one row here with just the extra small grid in it. We can actually divide this into two rows, so I'm going to go ahead and add that here. It's a slash div for row number one, and a div with class of row here, just so that things are adding up to 12, even though they don't have to add up to 12, for the extra small grid system.

So, now that I've got those in place, let's just see what we've got so far. If I go ahead and save this page and I refresh my web browser. Already, that's looking pretty good. I've got my series of pictures here. I've got a little text underneath and things are looking good. As I make my page narrower, that photo gallery is still looking good all the way on down to these small mobile dimensions. And notice that I have a class of image-responsive on all of those images so that they are scaling properly as well. All right, so that's pretty good, but they still don't really look like thumbnails, per say, and the way that we actually turn these in to.

Things that look like thumbnails, as opposed to just sort of a grid of pictures with text is we're going to add a little bit of additional code. So, after the div with a class of col-xs-6, which is on line 29, I'm going to add one more div. With a class of thumbnail. And that div is going to wrap all the way around the image and the paragraph as well and then we'll end that div. So this is a lot of divs that are involved here. And then the last thing. If I just save this with this additional div with a class of thumbnail and put that in your browser you'll wind up getting this nice little border that goes around things.

But this caption isn't quite beautiful yet, either. So we can add, inside of the paragraph tag you can add a class of caption. Save that and then refresh your page again and we you'll see that we have a nice full caption here that is not shoved all the way on to the edge of the border here on our thumbnail. Now, this paragraph with the class of caption, because I only have one line of text here, I have taken the class of caption and I put it inside the paragraph. If I had a heading and a couple of paragraphs of information and so forth that were all associated with this thumbnail, I could put that classic caption inside of a div.

And wrap the div all the way around that instead. But because I just have one line of text here, I eliminated that extra div. I did try putting thumbnail inside of my grid here, so it was call extra small six and thumbnail together on the same div, and things didn't look quite right. So I think you really do have to break these out as separate divs in this particular case. All right, so if I go on through here my other examples in this page, adding this div of the class of thumbnail which would come right after the call extra small six and then adding this p with the class of caption, I'm just going to go ahead and do that here really quick.

Alright. So I've put in all my div with classes of thumbnail, I've put in all my Ps with class of caption. If you go ahead and save this now and come back to your browser and refresh you should then see four lovely thumbnails with captions that should stay lovely no matter how wide or how narrow the pages. And it looks like that that is working well here for us. There we go. So that is how you layout a thumbnail gallery using Bootstrap. What you might want to do at this point now? Is these little pictures should probably lead to something else.

You can either just do a simple link to a larger version of that picture, maybe on another web page, you can make use of Bootstrap's mobile windows, so that when you click these thumbnails, you know, it will come out on a mobile window or something. Just adding these thumbnails and the styling here. Makes these look like thumbnails that would be clickable and something that you would incorporate into your web page, but the functionality behind them isn't there yet. You're going to have to do some extra programming to make these truly functional thumbnails that you would click on and get a larger version of the image.

Show transcript

This video is part of

Image for Up and Running with Bootstrap 3
Up and Running with Bootstrap 3

37 video lessons · 24837 viewers

Jen Kramer
Author

 
Expand all | Collapse all
  1. 5m 25s
    1. Welcome
      58s
    2. Using the exercise files
      1m 19s
    3. Installing Sublime Text 2
      3m 8s
  2. 29m 0s
    1. What is Bootstrap?
      8m 1s
    2. Downloading and unzipping Bootstrap 3
      4m 31s
    3. Examining Bootstrap file structure
      4m 34s
    4. Adding CSS to a Bootstrap HTML file
      4m 35s
    5. Adding JavaScript to a Bootstrap HTML file
      7m 19s
  3. 44m 38s
    1. Exploring Bootstrap's grid system
      9m 10s
    2. Creating new rows and cells
      14m 5s
    3. Adjusting column widths using offset
      5m 2s
    4. Changing column order using push and pull
      5m 34s
    5. Nesting columns
      3m 43s
    6. Creating a JumboTron-style layout
      3m 41s
    7. Challenge: Working with grids
      1m 31s
    8. Solution: Working with grids
      1m 52s
  4. 53m 34s
    1. Exploring basic typography: The small and blockquote tags
      4m 29s
    2. Exploring Bootstrap's responsive classes including .hidden and .visible
      4m 44s
    3. Styling buttons using btn classes
      4m 43s
    4. Styling images with responsiveness and decorative touches
      5m 22s
    5. Incorporating Bootstrap 3 glyph icons
      3m 28s
    6. Creating a thumbnail gallery
      6m 2s
    7. Styling tabular data
      5m 3s
    8. Overriding core CSS with custom styles
      12m 53s
    9. Challenge: Styling panels and callouts
      2m 17s
    10. Solution: Styling panels and callouts
      4m 33s
  5. 27m 41s
    1. Implementing location breadcrumbs
      6m 38s
    2. Using tabs and pills for navigation
      6m 58s
    3. Developing a responsive navigation bar
      9m 9s
    4. Challenge: Modify the "pancake" button
      1m 3s
    5. Solution: Modify the "pancake" button
      3m 53s
  6. 37m 45s
    1. Implementing dropdowns within a navigation bar
      5m 5s
    2. Tabbing within the same page
      15m 45s
    3. Accordion panels with collapse functionality
      11m 37s
    4. Challenge: Tooltips
      1m 59s
    5. Solution: Tooltips
      3m 19s
  7. 3m 0s
    1. Next steps towards advanced Bootstrap
      3m 0s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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.


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.

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 3.

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 preferences from 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

Your file was successfully uploaded.

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.