Up and Running with Bootstrap 3
Illustration by John Hersey

Changing column order using push and pull


From:

Up and Running with Bootstrap 3

with Jen Kramer

Video: Changing column order using push and pull

The next thing I'd like to look at is reordering your columns in Bootstrap. This is something that's new to Bootstrap. But something that Foundation has had a while. But this is new to Bootstrap in version three. And so I'm taking a look at HTML file 02_04.html. You'll find this in your exercise files folder. And if you go ahead and copy that into your bootstrap folder and then open it up here in Sublime Text. Right click anywhere on the page and say Open in Browser, and this is going to show you the web page.
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

Changing column order using push and pull

The next thing I'd like to look at is reordering your columns in Bootstrap. This is something that's new to Bootstrap. But something that Foundation has had a while. But this is new to Bootstrap in version three. And so I'm taking a look at HTML file 02_04.html. You'll find this in your exercise files folder. And if you go ahead and copy that into your bootstrap folder and then open it up here in Sublime Text. Right click anywhere on the page and say Open in Browser, and this is going to show you the web page.

It's, basically it's the same as the stopping state from video number three, and you'll see here that we have our page as it's progressing, we have our extra space here that's caused by the offset in between the two columns, and as you make this page smaller, everything looks great until you get to the mobile version of the site. And now what's happening is everything is stacked on top of each other here. And, that's exactly what's suppose to happen according to the grids that we're using. But, what we'd like to have happen is, we'd like to have this text here about services appear at the top of the page.

And this blurb of text here about the dental medicine. We'd like to actually have underneath. Now there's a couple of ways that we can make that happen. One way would be, instead of having the setup as a left column plus services over here on the right we could just take this block of text on the left and move it all the way over to the right, so instead of having a left column we have a right column. When the page collapses, then things are going to line up just fine. And that's certainly one approach. But what if your client is insisting that you have a left column, that you can't have a right column? Well, in that particular case you're going to need to use this new trick that comes with Bootstrap.

Which will allow this to appear to have a left column here on this page. But as you reduce the size of the page. And you get to the point where the content is starting to stack. Then you're going to have services at the top. And the aside information here about the dental medecine will occur at the bottom of the page. Alright, so, to do this. Here in row two, we're around line 26, starting with the aside here. The first thing that we're going to need to do, is we're going to need to make sure that the source code itself is in the right order.

So we are in fact just going to take this aside. That's lines 26 through 30. An I'm going to, remove that. Just cutting it. An then after the slash article that's now here on line 30. I'm going to paste in that aside again. So, just by doing this little bit here, and saving, and refreshing my page. You'll see that, now it's all in the right order. We've got services on the top. We got the dental medecine on the bottom. Now, if I start the stretch the page out, though, I have a right column instead of a left column.

Which is not what we want. Also notice that I have all this extra space over here on the side of services. Where is that coming from? Well, you're right. That's coming from the offset that we have associated with that Services column. That's why that's there. Got rid of the offset, then the Services would line up nicely right under the logo. So, we're part of the way there. We've got it working at small resolutions, but not at large. So, the next thing we have to do then is we'll have to add some extra classes for this. So, to the article tag that's up here on line 26, we're going to add some more classes.

So, after the call-SM-7. We're going to add the following, call-lg -push-3, and then put a space and we're going to do the same for the small grid, call-sm-push-4. So what are we doing here? What does this mean? We're going to push this article across the page. So if you think of it's current position here inside of the browser, what we want to do is apply a push to the left side of the services article and push it across the page, either three or four columns, depending on what kind of screen resolution that we're talking about.

So that's what that class is doing. Now that we've pushed that across the page we now have some empty space over there to the left of the article. And so what we're going to want to do then for the aside, down here on line 31, is of course. We'd want to pull that back across the page, we want to pull it towards the left to make it appear over there in that empty space, so the classes we need to add over on that side is just after the call hyphen SM hyphen 4 here on line 31. We will add col-lg-pull-9, and col-sm-pull-8.

So once again, we're pulling the side to the left side of the page by nine columns, or we're pulling it by eight columns on the small grid. Alright, so go ahead and save this. And we're going to go ahead and refresh the browser and we're back to having a left column. So, you see that we have a nice left column here. We have our space in the middle. We have our services over here on the side. That's true for all of these big dimensions. And as I make my screen smaller. At that breakpoint. Low and behold, there we go. We've got our services on the top and we have our aside information down here underneath.

This is just so much better for search engine optimization because the main content is appearing at the top in the source order now. It's really just a visual trick that we have as, over here in the left column on the page. And that's really the way it's supposed to be. So you've improved the search engine optimization of your page, and it's working great now for the horizontal layout with multiple columns as well as the more vertically oriented mobile layout.

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.