I am developing a website and in it I created a service area where through CSS, HTML, PHP and Laravel I display the content dynamically, I make a foreach ...
As I do not limit how many records the user can include, he can include as many as he wants, which gives me a Layout problem when he does not include 3 in 3, see the image ...
Asyoucansee,thereareonly4recordsregistered,thelastonebeingatthebottomofthescreen,whichendedupgeneratingablankspaceontheright.
SoIask:HowdoIadjust?isthereanywaytogetjavascriptthesizeofthewhitespacesothatIcanhelpBoxviaCSS?
HTML/BladeCode
<sectionclass="servicos">
<div class="container">
<div class="row text-center">
<h2><i class="fa fa-briefcase" aria-hidden="true"></i> S e r v i c o s </h2>
<hr>
</div>
</div>
<div class="col-xs-12">
<div class="container">
@forelse($servicos as $dados_servicos)
<div class="col-xs-4">
<div class="box col-xs-12">
<div class="icone text-center">
<i class="fa {{$dados_servicos->caminhoicone}} fa-4x" aria-hidden="true"></i>
</div>
<h3 class="text-center titulo">{{$dados_servicos->titulo}} </h3>
<p class="texto">{!!$dados_servicos->post!!} </p>
</div>
</div>
@empty
Nenhum Serviço Cadastrado
@endforelse
</div>
</div>
</section>
CSS
.servicos .box{
border-radius: 3%;
text-align: center;
margin-left: 6%;
margin-top: 10px;
width: 300px;
height: 300px;
background-color:#a09f9d;
font-family: "Roboto-Light";
float: left;
/*background-color: rgba(255, 255, 255, .4);*/
cursor: pointer;
}
.servicos .box:hover{
box-shadow: 15px 15px 15px 15px rgba(0, 0, 0, 0.3);
transition: all 1.0s ease;
}
.servicos .box .icone{
margin-top: 10px;
color: white;
}
.servicos .box .titulo{
color:white;
font-family: "Roboto-Light";
overflow: hidden;
font-weight: bold;
}
.servicos .box .texto{
position: relative;
font-family: "Roboto-Light";
color: white;
margin-top: 10px;
overflow: hidden;
}