From the course: Bootstrap 4 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Control positioning

Control positioning - Bootstrap Tutorial

From the course: Bootstrap 4 Essential Training

Start my 1-month free trial

Control positioning

- [Instructor] There are a few ways to control the positioning of your elements in Bootstrap, and they correspond to the positioning classes that you have in regular CSS, so if we look at our options here, we can add a fixed-top class, and that will take an element, position it on top of the existing content at the top of the screen, and it'll stick there to the top forever. Now, you can also use a fixed-bottom that will take the content and position it at the bottom, and in addition to that, there's another class that's pretty interesting, called sticky-top, it will make some content stick to the top of the screen as we scroll the screen. That's pretty cool, but, it's not fully compatible with older browsers, so you do have to watch when you use that one a little bit. You also have to add spacing where needed, because when we tell something to fix itself to the top or the bottom of the screen, it's going to essentially sit on top of existing content. Sometimes that's not a problem…

Contents