how to create a grid in boostrap with 3 frames

1

Hello I have given to learn bootstrap 4 and now I have presented this difficulty (design a blog) I want to locate a container with 3 large squares that cover half and the other two smaller ones on top of each other but not as a picture is made help a little more

and this is the code that I have so far but the second row wrongly places the boxes

<div class="container-fluid">
            <div class="row">
                <div class="col-sm-12 col-md-7 b">
                    <h5>...</h5>
                    <p>...</p>
                </div>
                <div class="col-sm-12 col-md-5">
                    <div class="row">
                        <div class="col-sm-12 c"></div>
                        <div class="col-sm-12 d"></div>
                    </div>
                </div>
            </div>
        </div>
    
asked by crt 03.04.2018 в 04:30
source

2 answers

2

Bearing in mind that you want to make a grid that apparently always has the same layout, you can simply add the respective classes to the right column so that the "main" container of that column occupies 100% of the high h-100 and to the two subcontainers, apply 50% of the height to each with the class h-50 .

.b {
      background-color: red;
    }

    .c {
      background-color: blue;
    }

    .d {
      background-color: black;
    }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
            <div class="row">
                <div class="col-sm-12 col-md-7 b">
                    <h5>...</h5>
                    <p>...</p>
                </div>
                <div class="col-sm-12 col-md-5">
                    <div class="row h-100">
                        <div class="col-sm-12 c h-50">..</div>
                        <div class="col-sm-12 d h-50">..</div>
                    </div>
                </div>
            </div>
        </div>
    
answered by 03.04.2018 / 05:20
source
1

Maybe something like this will help:

.row{
  
  height: 200px;
  
}
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title>Hello, world!</title>
  </head>
  <body>
<div class="container-fluid">
    <div class="row">
      <div class="col-sm-6 bg-dark ">
        <h5>Titulo</h5>
        <p>Texto</p>
      </div>
      <div class="col-sm-6 d-flex align-items-stretch">
        <div class="row">
          <div class="col-sm-12 bg-primary ">Cuadro uno</div>
          <div class="col-sm-12 bg-danger">Cuadro dos</div>
        </div>
      </div>
    </div>
  </div>


    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  </body>
</html>

Only the responsive party would be pending.

    
answered by 03.04.2018 в 05:27