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

Understanding fluid offsetting


From:

Up and Running with Bootstrap 2

with Jen Kramer

Video: Understanding fluid offsetting

So here's the web page that we built in the previous video. What I really wanted to have happen is I wanted to have a left column of this page, and I wanted to have a few articles listed on the right side of the page. Although this third row looks like I have an article on the left side of the page and more information about it over on the right, it would obviously look a lot better if I had the articles all lined up one after the other. But for the second article, I don't really want anything to appear over in the left-hand column. So what can I do? In Bootstrap, this is called offsetting, and it's very easy to set up.

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

Understanding fluid offsetting

So here's the web page that we built in the previous video. What I really wanted to have happen is I wanted to have a left column of this page, and I wanted to have a few articles listed on the right side of the page. Although this third row looks like I have an article on the left side of the page and more information about it over on the right, it would obviously look a lot better if I had the articles all lined up one after the other. But for the second article, I don't really want anything to appear over in the left-hand column. So what can I do? In Bootstrap, this is called offsetting, and it's very easy to set up.

So I can set this up such that I can have the two articles appear underneath of each other and not have a left column in the second row. Remember that every row has to add up to 12. There has to be 12 columns, no matter what you do. So offsetting is a way of allowing you to have those 12 columns represented, even if they're not all containing content. So, I'm going to go back to Dreamweaver here at the bottom of my screen, and I am going to make a couple of quick changes to this page.

So just to make my articles stand out a little bit more here in the second row, I am on line 25, I'm going to add an h2, and I'm going to call this Article title, and then down here in the second row, I'm going to get rid of this aside with class of span3 on lines 35 through 37. I'm just going to make that go away. I really don't want it. And I'm going to clean up the markup here in this particular article a little bit as well, so it has an heading, another article, and of course, underneath that would be a paragraph with whatever text happens to be contained in that article.

So, now what I need to do is inside of this third row that you see here, we have a span9, but we don't have the other three columns accounted for just yet. So, the way to do this is to use the offset. So, I'm going to say span9 offset3, all one word. These offset classes, again, range from 1 to 12, and what they'll do is they'll add blank columns on the left side of your particular row. So, with an offset of 3, it's going to add 3 columns on the left side of the screen that will be blank followed by the article, which will occupy there 9 columns on the right side.

So I am going to go ahead and save this page, File > Save, and I put this into Firefox. Now you can see that I have a left column on this web page, and I have the two articles that are appearing underneath. So all those line up a whole lot better on the page, or it looks a whole bunch better than it did before. I may also want to do something with this copyright. Right now the copyright is located down in the bottom of this web page. It's got a span of 12 on it, so it goes all the way across the bottom. Perhaps what I really want to do is shorten that up and have it appear just on the right side of the page.

I can do that also with offsets. So I go back to Dreamweaver. Down here on the bottom rather than a class of span12, what if I did a class of Span2, and I did an offset of 10 and then down here on the bottom, I could put in a copyright symbol under Insert > HTML > Special > Characters > Copyright, and then I could put in some actual text here, 2012 lynda.com? Go ahead and save that. So File > Save.

And now when I go back to my Firefox, and I Refresh my web page, you'll see that I've got the copyright statement is now appearing over towards the right side of the screen, exactly the way that I want it to. So in this particular video, we have taken a look at the offset property inside of the grid. This allows you to have a row with all 12 columns accounted for even if not all 12 of those columns are going to contain some kind of content.

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

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.