Bootstrap Row hits breakpoint too late

Issue

With the current code below, the row does not change vertically until the dimensions 234 x 668

.contbg {
  background-color: #FF0000;
}

.rowbg {
  background-color: #FFFF00;
}

.colbg {
  background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>


<a>TEST</a>
<div class="container-fluid">
  <div class="row">
    <div class="col colbg">
      <div class="container cont2">
        <div class="row-2 rowbg">
          TTITLE
        </div>
        <div class="row-10 rowbg">
          <img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
        </div>
      </div>
    </div>
    <div class="col colbg">
      <div class="container cont2">
        <div class="row-2 rowbg">
          TTITLE
        </div>
        <div class="row-10 rowbg">
          <img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
        </div>
      </div>
    </div>
    <div class="col colbg">
      <div class="container cont2">
        <div class="row-2 rowbg">
          TTITLE
        </div>
        <div class="row-10 rowbg">
          <img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
        </div>
      </div>
    </div>
  </div>
</div>

I’m trying to make it rearrange once it hits under 450w but when I add row-sm to the first row

    <a>TEST</a>
    <div class="container-fluid">
      <div class="row-sm">
        <div class="col colbg">

it makes the entire container vertical instead of horizontal right from the start. How can I fix this?

Solution

I was missing col-sm-4 added to every column

.contbg {
  background-color: #FF0000;
}

.rowbg {
  background-color: #FFFF00;
}

.colbg {
  background-color: #00ff00;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</head>


<a>TEST</a>
<div class="container-fluid">
  <div class="row">
    <div class="col-sm-4 colbg">
      <div class="container cont2">
        <div class="row-2 rowbg">
          TTITLE
        </div>
        <div class="row-10 rowbg">
          <img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
        </div>
      </div>
    </div>
    <div class="col-sm-4 colbg">
      <div class="container cont2">
        <div class="row-2 rowbg">
          TTITLE
        </div>
        <div class="row-10 rowbg">
          <img class="img-fluid rounded-3" src="https://source.unsplash.com/collection/190728/1500x900" alt="">
        </div>
      </div>
    </div>

Answered By – The Ultraempoleon

Answer Checked By – Candace Johnson (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.