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

Exploring Bootstrap's responsive classes including .hidden and .visible


From:

Up and Running with Bootstrap 3

with Jen Kramer

Video: Exploring Bootstrap's responsive classes including .hidden and .visible

So I'm taking a look at my services page again, this is from HTML file 03_02 in your exercise files folder. Copy it on into your Bootstrap folder. Open it up in your browser, and you should see something like this. This is a page that we built in the previous chapter working on the grid system. And one of the things that's been bugging me about this page, maybe it's been bugging you, too. It looks great while it's big like this. As I start to make the page smaller, it's still looking good. I like the way these are stacking down here on the bottom, but when we get to this break point here, right here, there we go, these animals that look so great on the larger screen dimensions, wrap underneath the logo here.
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

Exploring Bootstrap's responsive classes including .hidden and .visible

So I'm taking a look at my services page again, this is from HTML file 03_02 in your exercise files folder. Copy it on into your Bootstrap folder. Open it up in your browser, and you should see something like this. This is a page that we built in the previous chapter working on the grid system. And one of the things that's been bugging me about this page, maybe it's been bugging you, too. It looks great while it's big like this. As I start to make the page smaller, it's still looking good. I like the way these are stacking down here on the bottom, but when we get to this break point here, right here, there we go, these animals that look so great on the larger screen dimensions, wrap underneath the logo here.

And it just kind of looks silly to me. It's not really adding anything to the page at this point, particularly as this gets even narrower. That animal picture really isn't adding a lot to the site. It's just pushing content down the page. Although it serves a great purpose here at the larger dimensions. Where we have this image up here in the upper right corner. So what I'd like to do is, I'd like to find way to get rid of that image where we're at smaller dimensions. So I'm going to show you how to do this using Bootstrap's visibility and responsive utility classes. Before I do that, let me just give you a little bit of background about something to consider.

The classes that I am about to show you are tied to media queries and they're designed to show or hide elements depending on the width of the screen. So they are frequently used for the kind of trick that I am going to show you here, which is. Give me this image and show it over here on the right when my screen is particularly wide and get rid of it when the screen is smaller, something like that. Be aware that even though I am going to use a class that effectively has a CSS display of none associated with it. That image of these animals is still going to download on a mobile phone, which will still increase the size of the page overall.

And if you have a bunch of these kinds of images on your page and you're just hiding things as you get down to smaller and smaller screen sizes, what you're going to do is. You're still going to be downloading all these pictures to the phone, even though they aren't displaying on the page. And when a phone is running over a network, particularly a slow network, that is going to make your page download time very small so you could wind up still with a very beefy webpage with all of these images that you're hiding. There's better ways of dealing with images in Responsive design. There's JavaScript tricks you can use, there's server side techniques you can use, they're all beyond the scope of this course but treatment into images is something that you should look into and I kind of feel what I want to show you now is a little bit of a hack to hide this picture at smaller dimensions.

But these are classes that are available in Bootstrap, so I'm going to show you how they work. Just be careful not to use them for evil. Anyway, here we are. This is our HTML page. And we are going to scroll on down here to line number 20. And so this is the call to that particular little decorative image. We don't even have an ALT tag for this. It's just a decorative image on the page to make it look pretty. So right now, this is going to show at any of the screen dimensions. But if you take a look at Bootstrap's documentation here, this is under getbootstrap.com.

Click on CSS, and then click on Responsive Utilities further down on the page, here. These are a whole series of classes that are tied to the media queries inside of Bootstrap, so there are a series of these classes that are for an element being visible at certain dimensions, corresponding to grid sizes, extra small, small, medium, and large, and there are dimensions here to hide elements at certain dimensions. So what I really like to have happen is, at less than 768 pixels, which is where that animal starts to wrap, I'd like to hide it completely.

So the class that I need to use here is dot hidden dash xs. So, hide those at extra small dimensions. Just remember it's still going to download, but it will not display on the web page. So, I am going to go ahead and add that here, inside of line 20, we are going to add a class of hidden hyphen xs. And if you go ahead and save that and then, refresh your page here in your browser. There we go. There's our animals sit there, a fairly broad dimension here, probably around 1300 pixels. As we start to get narrower, you'll see that the screen is adapting.

Things are looking good until we hit this break point, there, and now that image is just gone entirely. So, I think that this works better for the mobile dimensions. It's definitely a little bit of open white space here, but I don't think it looks really terribly bad at this particular dimension, and as we get even narrower here. It definitely looks a lot better at these narrower dimensions not to have that animal picture pushing the content down on the page. So there's several of those responsive classes inside of Bootstrap, and I would encourage you to take a look at these and explore them for use in your website.

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

Upgrade to View Courses Offline

login

With our new Desktop App, Annual Premium Members can download courses for Internet-free viewing.

Upgrade Now

After upgrading, download Desktop App Here.

Course retiring soon

Up and Running with Bootstrap 3 will be retired from the lynda.com library on September 25, 2015. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion. For updated training, check out Bootstrap 3 Essential Training in the lynda.com Online Training Library.


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:

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.

Start your FREE 10-day trial

Begin learning software, business, and creative skills—anytime,
anywhere—with video instruction from recognized industry experts.
lynda.com provides
Unlimited access to over 4,000 courses—more than 100,000 video tutorials
Expert-led instruction
On-the-go learning. Watch from your computer, tablet, or mobile device. Switch back and forth as you choose.
Start Your FREE Trial Now
 

A trusted source for knowledge.

 

We provide training to more than 4 million people, and our members tell us that lynda.com helps them stay ahead of software updates, pick up brand-new skills, switch careers, land promotions, and explore new hobbies. What can we help you do?

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.