0
Using the bootstrap
I have the following code DEMO:
<div class="container">
<div class="page-header">
<h1>Seja bem vindo <small>Selecione um curso:</small></h1>
</div>
<div class="well col-sm-4">
<h4 class="text-center"><strong>Aminésia de velhos e novos durante a vida toda Aminésia de velhos e novos durante a vida toda</strong> </h4>
<h5 class="text-center"><strong>Turma:</strong> Turma 4</h5>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
<div class="well col-sm-4">
<h3 class="text-center"><strong>Curso:</strong> Aminésia</h3>
<h4 class="text-center"><strong>Turma:</strong> Turma 4</h4>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
<div class="well col-sm-4">
<h3 class="text-center"><strong>Curso:</strong> Aminésia</h3>
<h4 class="text-center"><strong>Turma:</strong> Turma 4</h4>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
<div class="well col-sm-4">
<h3 class="text-center"><strong>Curso:</strong> Aminésia</h3>
<h4 class="text-center"><strong>Turma:</strong> Turma 4</h4>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
<div class="well col-sm-4">
<h3 class="text-center"><strong>Curso:</strong> Aminésia</h3>
<h4 class="text-center"><strong>Turma:</strong> Turma 4</h4>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
<div class="well col-sm-4">
<h3 class="text-center"><strong>Curso:</strong> Aminésia</h3>
<h4 class="text-center"><strong>Turma:</strong> Turma 4</h4>
<h5 class="text-center"><strong>Inicio:</strong> 01/01/2014</h5>
<h5 class="text-center"><strong>Final:</strong> 01/12/2014</h5>
<a href="#" class="btn btn-success center-block">Acessar</a>
</div>
</div>
The problem is in the first div
, it has a larger text than the others so the div
below loses line alignment.
Those divs
are generated dynamically. I know I may be making a if
to be adding a row
every three divs
.
But I wonder if there’s another way without polluting with ifs
.
You cannot set a minimum height pro box that has the largest text?
– bfavaretto
@bfavaretto, I don’t understand!
– Diego Zanardo
This problem is because of the way floats work (the
<div class="well">
are floated). If all Divs have the same height, the problem disappears. I am suggesting that you swallow the height of the Divs to a reasonable size to fit the largest text. Example: http://www.bootply.com/vuZL97HOLB– bfavaretto
@bfavaretto, got it... That’s better than adding a Row?
– Diego Zanardo
I don’t have much experience with bootstrap, adding a Row seems another good solution.
– bfavaretto
Man this can solve your problem, I had the same recently and it was what I needed. http://masonry.desandro.com/
– Uéder Wp