Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Changing column order using push and pull

From: Up and Running with Bootstrap 3

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.

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.

Show transcript

This video is part of

Image for Up and Running with Bootstrap 3
Up and Running with Bootstrap 3

37 video lessons · 28397 viewers

Jen Kramer
Author

 
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. 44m 38s
    1. Exploring Bootstrap's grid system
      9m 10s
    2. Creating new rows and cells
      14m 5s
    3. Adjusting column widths using offset
      5m 2s
    4. Changing column order using push and pull
      5m 34s
    5. Nesting columns
      3m 43s
    6. Creating a JumboTron-style layout
      3m 41s
    7. Challenge: Working with grids
      1m 31s
    8. Solution: Working with grids
      1m 52s
  4. 53m 34s
    1. Exploring basic typography: The small and blockquote tags
      4m 29s
    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 41s
    1. Implementing location breadcrumbs
      6m 38s
    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 learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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.

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 ?

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