I was using a version 3 of Bootstrap. Now that I updated to version 4 I have the following problem:
It worked for me with Bootstrap 3 ( see full page ):
.titulo {
height: 200px;
background: #666;
border: 1px solid #333;
}
.dato {
height: 100px;
background: #666;
border: 1px solid #333;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="titulo col-lg-3 col-md-4 col-sm-4">Titulo</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">1</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">2</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">3</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">4</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">5</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">6</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">7</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">8</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">9</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">10</div>
</div>
And the same code stopped working for me with Bootstrap 4:
.titulo {
height: 200px;
background: #666;
border: 1px solid #333;
}
.dato {
height: 100px;
background: #666;
border: 1px solid #333;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="row">
<div class="titulo col-lg-3 col-md-4 col-sm-4">Titulo</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">1</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">2</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">3</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">4</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">5</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">6</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">7</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">8</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">9</div>
<div class="dato col-lg-3 col-md-4 col-sm-4">10</div>
</div>
Question:
How can I make the div .titulo
take up 2 rows, and the divs .dato
wrap responsively, using the remaining space, according to whether it's a device sm
or lg
? The divs have a fixed height (the title is 2 times the height of the rest).
It is worth clarifying that I build the small boxes dynamically with an ngFor
angular, therefore dividing them into containers in a fixed way is not an option. The code I have to generate them is:
<div class="dato col-lg-3 col-md-4 col-sm-6"
*ngFor="let dato of datos">
{{dato.nombre}}
</div>