Up and Running with Bootstrap 3
Illustration by John Hersey

Up and Running with Bootstrap 3

with Jen Kramer

Video: Adjusting column widths using offset

So the next thing I'd like to talk about is offsetting your columns. Which is the process of having a little bit more space between two columns on the page. So I am taking a look at files 02_03. This comes from your exercise files folder. Just copy this HTML file over into the bootstrap folder. And then all of your images and JavaScript and CSS and so forth should work correctly, if you do that. And, let's just go ahead and start by taking a look at this page in your web browser. So, if you'll right click or Cmd click anywhere on the page and pick Open in Browser, you'll see the page layout 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

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

Adjusting column widths using offset

So the next thing I'd like to talk about is offsetting your columns. Which is the process of having a little bit more space between two columns on the page. So I am taking a look at files 02_03. This comes from your exercise files folder. Just copy this HTML file over into the bootstrap folder. And then all of your images and JavaScript and CSS and so forth should work correctly, if you do that. And, let's just go ahead and start by taking a look at this page in your web browser. So, if you'll right click or Cmd click anywhere on the page and pick Open in Browser, you'll see the page layout here.

So, here we go. And what we have here is the main article, which is this thing called Services. And we have a nice little picture to go with that. On the left side of the page we have a little bit of text here. Sort of a supplementary kind a thing, a highlight of the dental services that Wisdom Pet Medicine offers. And so, what I'd like to do though is I'd like to get a little bit more space between these columns. So you'll see here that we have a bit of space here between the two columns. But what I'd really like to have happen is have just a little bit more breathing room between those. So of course one possible solution is go to mess with grid system and try to establish more space here.

But that can have all kinds of unintended consequences for other pages. I mean it's the grid system that you'd be messing with. What is a, probably a better approach is what if I take one of my extra columns and have it as part of the grid here. But, what it's going to do is just display nothing. So in other words, if I have my left column at three columns wide. And my main content over here at let's say eight columns wide. That's a total of 11. Then I want one additional column in between the two that's just plain old white space and that will still add up to 12.

So that's what offsetting is all about. So if we take a look here inside of Sublime Text. And I'm going to scroll on down here to row number two. Which is around line 24. So here is the markup for this particular page. You'll see on 926. This is an aside. Aside is an HTML5 tag that is designed for just this very kind of text. It's not necessarily absolutely critical to the page. If it was cut off, you could still understand the content of the services page. But it is something of an aside, it's not the main focus of the page.

So that's what the purpose of the aside tag is and that's why I've chose to use it here. And then next to that we have an article and of course this is the main meat and potatoes of this particular website. And so the article is the tag that I'm using for that other side of the page. Just to, using a little bit more the semantic markup from HTML5. And as you'll see here, I'm using my small and my large grid on this page, so I have a large grid of three here. When the page is very wide and small grid of 4, and then on the article the large grid of nine because 3 plus 9 is 12.

And 8 here on the small group, so 4 plus 8 is 12. So, you want to make sure that your numbers are adding up in the large column. Your numbers are adding up for the small column, and so far everything is great. What I'd like to do now, is I'd like to take that extra column somewhere and establish that bit of white space. So, what I'm going to do to make that happen is, i'm going to back off these numbers. So, instead of nine, I'm going to make it eight. And instead of eight, I'm going to make it seven. And then I'm going to add two more classes. So what I'll say here, is, after the column large eight.

I will say, col-lg-offset-1. So, in other words. We're going to make this article eight columns wide and we're going to have an offset of one. I put it here on the article, because the offset's always added to the left side. So, if we edit the offset here to our aside, it would be added to the left of the aside. In other words, the aside would be pushed over one column on the page. And we actually wouldn't get any extra space between the aside and the article.

So this is now offset one column here on the left of the article. So we should get that space in between the two. And then we're going to have to do the same thing for the small grid. We're going to have to add its offset as well. So this is going to be call-sm-offset-1. So, if you were using three or four kinds of grids here, you'd have to add the offset for each one of those. Or, of course, you don't have to use the offset for each grid. You could decide that, for some other resolutions, maybe you don't want an offset at all.

But for the ones that you do want an offset, you're going to have to specify it here. Okay, so we go ahead and save this page, File > Save and if you show this in your browser. I'm just going to refresh what I have here, you'll see that services is moving over to the right. And, as I make this page smaller. You'll see that, that space is maintained as I hit various breakpoints along the way. Right up until each of these blocks of text goes vertically on down the page. Now, one of the things you might notice at this point is that, of course with the left column by default, what you have is this text at the top of the page.

About keeping your pet's chompers clean and healthy and services is buried underneath. You might want to try reordering that and I'm going to show you how to do that in the next video.

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.