🔥 $100K Hit! Where Will Bitcoin Go Next? Find Out Live!

Code has been added to clipboard!

When and How to Use Bootstrap Large Grid Classes

Reading time 3 min
Published Nov 21, 2017
Updated Oct 2, 2019

Whenever you're publishing a web site or application, you want to make it accessible to your audience. It will all be in vain if they see it displayed incorrectly. One of the ways to avoid this is by using Bootstrap 4 responsive classes that make a website adapt to any screen size.

As we covered Bootstrap utility classes, we told you there are five classes to use for sizing Bootstrap layouts: extra small, small, medium, large and extra large. In this tutorial, we will show you how to use the Bootstrap large grid class in your work and combine it with other classes for more flexibility.

Large Grid: Main Tips

  • Bootstrap 4 grid system offers a set of responsive classes to specify on what screens a certain layout works.
  • The large class applies a grid column class to an element when the screen is wider than 991px.
  • Col-LG classes may be used on their own or with other sizing classes.

Applying the Class

The Bootstrap col-lg grid column classes apply when the screen is wider than 991px and collapses when it isn't. The prefix .col-lg-* is used to create columns that look like the ones you see below:

col-sm-4
col-md-8
col-lg-6
col-sm-8
col-md-4
col-lg-6

See the code example provided below. You will notice we combined three responsive grid column classes in it: col-sm-*, col-md-*, and col-lg-*. This means that if the screen or window is narrower than 991px (medium), the columns will rearrange slightly. If it is small (less 768px wide), the layout will rearrange again.

In case of an extra small screen (less than 576px wide), the layout collapses and appears stacked:

Example
<div class="container">
  <div class="row">
    <div class="bg-info col-md-8 col-sm-4 col-lg-6">
      ...
    </div>
    <div class="bg-primary col-md-4 col-lg-6 col-sm-8">
      ...
    </div>
  </div>
</div>

Of course, Bootstrap col-lg-* can be used on its own as well. See an example below to see how it's done:

Example
<div class="container">
  <div class="row">
    <div class="bg-info col-lg-6">
      ...
    </div>
    <div class="bg-primary col-lg-6">
      ...
    </div>
  </div>
</div>

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

Auto Layouts

An auto layout is created by not specifying the width of a Bootstrap grid column. All you have to do is skip the numbers for all column containers inside a row container. All columns will then become of the same width and together occupy the whole width:

Example
<div class="row">
<!-- Five 20% wide columns --> 
  <div class="bg-primary col-lg">1</div>
  <div class="bg-secondary col-lg">2</div>
  <div class="bg-primary col-lg">3</div>
  <div class="bg-secondary col-lg">4</div>
  <div class="bg-primary col-lg">5</div>
</div>

When you're using Bootstrap LG or any other sizing classes, keep in mind that your grid cannot exceed twelve columns in total width. For example, if you type col-lg-12 in your code, your grid will only have one column that spans through all available width.

Large Grid: Summary

  • The Bootstrap Col-LG responsive classes are applied in cases of a screen wider than 991px.
  • These classes can be used alone or combined with additional sizing classes other than col lg.