Mike Hawk
Mike Hawk

Reputation: 87

rows in Bootstrap grid don't line up

Just trying to make a second row of col-md-6s (I copied the "row" div and pasted it within the container div) but I can't seem to figure out why its not perfectly lined up. enter image description here

The last two lines of HTML code reflect the beginning of the second row.

.btn-group-vertical{
  border: 2px solid black;
  border-radius: 10px;
}
.col-md-6 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
#prod_view {
  height: 100%;
  background-color: lightcoral;
  display: flex;
  justify-content: flex-start;
  border: solid;
  border-radius: 10px;
}
.col-md-6 > div:last-child {
  width: 50%;
}
.boxclass {
  height: 95%;
  width: 50%;
}
<div class="container">
  <div class="row">

    <div class="col-md-6" style="background-color: lightcyan">
      <div class="btn-group-vertical btn-group-lg">
        <button type="button" class="btn btn-primary">Quick Select</button>
        <button type="button" class="btn btn-primary">Show in Depth</button>
        <button type="button" class="btn btn-primary">Delete Product</button>
      </div>
    <div>

    <div id="prod_view">
      <div class="boxclass" >
        <img alt="product" class="img-rounded" src="../Images/math.jpg" style="max-height: 100%; max-width: 100%;">
      </div>
      <div class="boxclass">some cool blocks all stacked up n shtufff</div>
    </div>

  </div>
</div>

<div class="col-md-6" style="background-color: lightgray">
  <div class="btn-group-vertical btn-group-lg">
    <button type="button" class="btn btn-primary">Quick Select</button>
    <button type="button" class="btn btn-primary">Show in Depth</button>
    <button type="button" class="btn btn-primary">Delete Product</button>
  </div>
<div>

<div id="prod_view">
  <div class="boxclass"></div>
  <div class="boxclass"></div>
</div>
</div>
</div>

<div class="row">

<div class="col-md-6" style="background-color: lightcyan">

Upvotes: 0

Views: 195

Answers (1)

Carol Skelly
Carol Skelly

Reputation: 362700

Works fine when the .row is closed properly...

http://www.codeply.com/go/OCsEsFb2Lr

<div class="container">
    <div class="row">
        <div class="col-md-6" style="background-color: lightcyan">

        </div>
        <div class="col-md-6" style="background-color: lightgray">

        </div>
    </div>
    <div class="row">
        <div class="col-md-6" style="background-color: lightcyan">

        </div>
        <div class="col-md-6" style="background-color: lightgray">

        </div>
    </div>
</div>

Upvotes: 3

Related Questions