Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.