loading

BS5 Grid XSmall

Extra Small Grid Example

 XSmallSmallMediumLargeExtra LargeXXL
Class prefix.col-.col-sm-.col-md-.col-lg-.col-xl-.col-xxl-
Screen width<576px>=576px>=768px>=992px>=1200px>=1400px

Let’s say we have a straightforward two-column layout. For EVERY device, we would like the columns to be split 25%/75%.

The classes listed below will be added to our two columns:

				
					<div class="col-3">....</div>
<div class="col-9">....</div>
				
			

A 25%/75% split will be produced on all devices (extra small, small, medium, large, and xlarge) by using the following example.

col-3

col-9

Example

				
					<div class="container-fluid">
  <div class="row">
    <div class="col-3 bg-success">
      <p>Lorem ipsum...</p>
    </div>
    <div class="col-9 bg-warning">
      <p>Sed ut perspiciatis...</p>
    </div>
  </div>
</div>
				
			

Note: You do not have to use all 12 of the available columns; just make sure the total comes up to 12 or less.

You would use .col-4 and .col-8 for a 33.3%/66.6% split (and .col-6 and .col-6) for a 50%/50% split:

col-4

col-8

col-6

col-6

Example

				
					<!-- 33.3%/66.6% split -->
<div class="container-fluid">
  <div class="row">
    <div class="col-4 bg-success">
      <p>Lorem ipsum...</p>
    </div>
    <div class="col-8 bg-warning">
      <p>Sed ut perspiciatis...</p>
    </div>
  </div>
</div>

<!-- 50%/50% split -->
<div class="container-fluid">
  <div class="row">
    <div class="col-6 bg-success">
      <p>Lorem ipsum...</p>
    </div>
    <div class="col-6 bg-warning">
      <p>Sed ut perspiciatis...</p>
    </div>
  </div>
</div>
				
			

Auto Layout Columns

You can easily make columns with the same width on all devices using Bootstrap 4 by removing the number from .col-* and using the .col class solely on the designated number of col elements. Bootstrap will determine the number of columns and set the width of each column to match:

				
					<!-- Two columns: 50% width-->
<div class="row">
  <div class="col">1 of 2</div>
  <div class="col">2 of 2</div>
</div>

<!-- Four columns: 25% width-->
<div class="row">
  <div class="col">1 of 4</div>
  <div class="col">2 of 4</div>
  <div class="col">3 of 4</div>
  <div class="col">4 of 4</div>
</div>
				
			

==== example aapvana ===

Share this Doc

BS5 Grid XSmall

Or copy link

Explore Topic