Up and Running with Bootstrap 3
Illustration by John Hersey

Styling images with responsiveness and decorative touches


From:

Up and Running with Bootstrap 3

with Jen Kramer

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Video: Styling images with responsiveness and decorative touches

The next thing I'd like to work on here on my website is dealing with these images. One of the things you might have noticed about these images in Bootstrap is that they are actually not responsive. Even though Bootstrap is a responsive design framework, images out of the box with Bootstrap are not responsive. Because as I make my page smaller here, my images are actually staying the same size. In fact, they start to get cut off. That's kind of obvious down here in these four images down towards the bottom of the screen. As I make this smaller and smaller, those images are staying the same size.
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. 43m 46s
    1. Exploring Bootstrap's grid system
      9m 10s
    2. Creating new rows and cells
      13m 17s
    3. Adjusting column widths using offset
      5m 2s
    4. Changing column order using push and pull
      5m 33s
    5. Nesting columns
      3m 42s
    6. Creating a JumboTron-style layout
      3m 40s
    7. Challenge: Working with grids
      1m 30s
    8. Solution: Working with grids
      1m 52s
  4. 53m 33s
    1. Exploring basic typography: The small and blockquote tags
      4m 28s
    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 40s
    1. Implementing location breadcrumbs
      6m 37s
    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

please wait ...
Watch the Online Video Course Up and Running with Bootstrap 3
3h 21m Beginner Oct 07, 2013

Viewers: in countries Watching now:

Meet Bootstrap, the one-stop shop for designing sleek, mobile-ready websites with HTML5, CSS3, and JavaScript. It's an open-source, responsive design framework, featuring a grid-based layout system, web-ready icons you can incorporate into your designs, fully functional navigation, and much more. Join Jen Kramer for a quick overview of all of the goodies in Bootstrap, and then learn how to customize the grid, override the CSS to customize your site, and leverage Bootstrap's stylish built-in JavaScript effects. Once you're prepared to test your knowledge, you can take the hands-on challenges offered by Jen.

Topics include:
  • Downloading and installing Bootstrap
  • Understanding the Bootstrap file structure
  • Exploring the 12-column grid
  • Changing column width and order
  • Styling buttons, images, and tables
  • Overriding core CSS
  • Creating a thumbnail gallery
  • Adding JavaScript effects, like dropdown menus, tabs, accordions, and more
Subject:
Web
Software:
Bootstrap
Author:
Jen Kramer

Styling images with responsiveness and decorative touches

The next thing I'd like to work on here on my website is dealing with these images. One of the things you might have noticed about these images in Bootstrap is that they are actually not responsive. Even though Bootstrap is a responsive design framework, images out of the box with Bootstrap are not responsive. Because as I make my page smaller here, my images are actually staying the same size. In fact, they start to get cut off. That's kind of obvious down here in these four images down towards the bottom of the screen. As I make this smaller and smaller, those images are staying the same size.

In fact I even have a little, a few little wrapping issues here. So, what I'd like to do then is I'd like to make these images responsive, which may be a really wonderful idea. In Bootstrap 3, you actually have to specify that specifically that you want those images to behave in a responsive manner in order for that to happen. So I'll show you how to do that. And the other thing I'd like to do is I'd like to add some nice little image effects to this page. For example, I'd like to do something with the Jumbotron picture here to make it look a little bit nicer. Maybe round a few corners in a couple of places, that kind of thing.

So what I'm going to do is I'm going to take a look at this file inside of Sublime text this is 03_04. Comes from your Exercise Files folder, copy it into the Bootstrap folder open it up here. And what I'm going to do first is I'm going to address these images and make them responsive. So for pretty much every image on the page, I'd like them all to be responsive. So I'm starting here at line 17, which is where my first image occurs. There is an image tag there. Just after that Alt tag, I'm going to add a class of IMG-responsive.

And this class I'm going to add in several places on the page. So I'm just going to copy that. And then I'm going to paste this in. Here on the second image, the animals image, I've already got a class here. So I'm going to go ahead and add img-responsive, and then further down here, in the Jumbotron, I'm going to add it, img-responsive. Then for each of these images down below here in the grid of four images. I'm going to go ahead and add the class of image responsive to each of these images and that's on lines 34, 42, 48 and line 54.

There we go. I think that's all the images that I have here on the page. So go ahead and save that and let's refresh this page. And so you won't see any change immediately while your screen is big, but as you now start to resize the page, hey look at this. Notice how the image sizes are starting to change and that gets really obvious as we get here at the narrow screen sizes. Alright. So that is the behavior that we've been, really been looking for all along. So, that is something that I would recommend that you add pretty much to all of your images, unless you have a darn good reason not to.

The other things that we can add to our images are some decorative kinds of classes. And these are kind of fun. So, for the Jumbotron image here, what I'd like to do is add a class here as well. We already have it floating to the right. That's this pull-right. There's our image responsive. I'd like to add another class, Img-circle. So this is going to actually put rounded corners on all four corners of this image. But they're rounded to such an extent that they wind up making the image look like an oval. So if you go ahead and do that and save it and then refresh your page, there we go there we have a nice little oval.

I think that, that adds a nice touch to that particular picture. So I'm going to go ahead and leave that. To this kitty picture here, I'm going to add another class to that. In fact to the kitty and the fish. So I'm down here on line 42 where I have a class of image-responsive. I'm going to add a class of img-rounded and this is going to make the image have rounded corners. So I'm going to put that here on that kitty cat image. That's line 42. And I'm also going to put it on line 54 here. That's the goldfish image.

And if I save that and I go ahead and refresh the browser. There we go. So now we have some nice little rounded corners there in that image. Also in the goldfish. Rounded corners don't make as much sense on the dog pictures here because it's kind of, got a white background. So those won't be obvious but what we could add to these is a thumbnail treatment. This used to be called the Polaroid in the previous version of Bootstrap. It's now called the Thumbnail in this current version of Bootstrap. So this would be the dog that's on line 48 here. So I can add img-thumbnail. And that's on line 48.

And then up on line 34. Img-thumbnail and so this is going to put a little gray border around those images. And with a white background image on a white background webpage that'll give these images a little bit more definition. So, if I refresh this page There we go. So now these images have got this little line around them. Maybe you like that, maybe you don't. But that's the third kind of treatment that you can add to your images. So just to summarize real quickly, those are classes that you can add to your images.

I recommend you add img-responsive to every image that you put into your Bootstrap website. This will allow your image to scale depending on the screen size. Then you have three decorative classes that you can add. Img-circle will give you a round image. Img-rounded will give you rounded corners on your image. Or Img-thumbnail will give you this nice little gray border around your image.

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


Expand all | Collapse all
please wait ...
Q: I don't see the respond.min.js file at the URL mentioned in the Chapter 1 movie "Adding JavaScript to a Bootstrap HTML file" (https://github.com/scottjehl/Respond). How do I access the file?
A: It appears the respond.js author updated the code or rearranged the file structure. You can find respond.min.js at this URL: https://github.com/scottjehl/Respond/tree/master/dest.
 
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.

* Estimated file size

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 ?

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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.