Bootstrap 3 two columns full height
Get the full-height columns train rolling in Bootstrap 3 by ensuring a height: 100%;
on both the .row
and the columns, and don't forget to throw in the html
, body
, and .container-fluid
as well. In code terms:
Just sprinkle .full-height
class salt on your Bootstrap columns and watch them reach up.
Building mobile-ready layouts
Ensuring the responsiveness of your columns is a vital consideration for users experiencing your layout in all its device glory. And with Bootstrap 3, you have an ally in the form of the grid system. Consider integrating media queries to manage the behavior of these full-height columns at varying breakpoints, like so:
This keeps smaller screens happy by allowing columns to revert to their natural height and preserve the content layout experience.
Using the table display method
Bootstrap 3 may not come with flex, but fear not. If older browsers, like IE8+, are a concern, you could always turn to the trusty old display: table;
method.
This is how you call forth these classes in your HTML:
Flexbox as an alternate road
If you're not cemented into Bootstrap 3, you might find joy in Bootstrap 4's flexbox model for a smoother drive on the full-height columns road. But fear not, we could still leverage the "Flexbox Freeway" in Bootstrap 3 with a sprinkling of modern CSS:
And here's how you breathe life into these classes:
Customizing column proportions
Need to adjust the proportion of the columns? No problem! Implement a 1:3 ratio for medium screens and higher. HTML and CSS to the rescue:
Markup magic to follow up:
Unveiling the demos
Theory is good, but practice is the key. To better understand these magical tricks in Bootstrap 3, take a stroll through interactive demos on CodePen or Bootply. Witness how these columns behave and adapt to different screen sizes.
Was this article helpful?