1
I have the following card system made with bootstrap 4
, each occupying 4 columns.
But I need that when they go to the mobile they see a Carousel
, I’m trying to use the Owl Carousel, but I need it to check if the resolution is small and display the Carousel
only if, if not, displays normal cards.
The problem is I don’t know how I can make him check the resolution and disappear the element as it.
I tried to use the class d-none d-sm-block
, she until the cards
when and mobile, but I need when it is not gone Carousel
.
.solucoes-box {
background-color: #fff;
padding: 4.5rem;
margin-bottom: 3rem;
transition: all 500ms ease;
}
.solucoes-box:hover{
box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
}
.solucoes-box .solucoes-ico {
margin-bottom: 1rem;
color: #004398;
}
.solucoes-box .icone-solucoes {
transition: all 500ms ease;
font-size: 3.5rem;
}
<div class="row">
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-hand-holding-usd"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">Vamos além!
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum mah a porta da esperanaam. Ma no existem mulher feiam, existem.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-comments"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">Mah oee
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum ma vai pra l. Ma o Silvio Santos Ipsum muitoam interesanteam. Com ele ma voc vai gerar textuans ha.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-handshake"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">texto
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum ma vai pra l. Ma o Silvio Santos Ipsum muitoam interesanteam. Com ele ma voc vai gerar textuans ha.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-balance-scale"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">Olha o aviazino
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum ma vai pra l. Ma o Silvio Santos Ipsum muitoam interesanteam. Com ele ma voc vai gerar textuans ha.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-comments"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">Mahoeee
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum ma vai pra l. Ma o Silvio Santos Ipsum muitoam interesanteam. Com ele ma voc vai gerar textuans ha.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="solucoes-box">
<div class="solucoes-ico">
<span class="icone-solucoes"><i class="fas fa-handshake"></i></span>
</div>
<div class="solucoes-content">
<h2 class="s-titulo">Quem quer dinheiro
</h2>
<p class="s-descricao text-center">
Silvio Santos Ipsum ma vai pra l. Ma o Silvio Santos Ipsum muitoam interesanteam. Com ele ma voc vai gerar textuans ha.
</p>
</div>
</div>
</div>
</div>
EDIT
I managed to get him to enter the owl-carousel
when the resolution is mobile, but it’s not getting centered on the screen as it should be, this whole mess.
I believe this is only possible by using Javascript.
– LeAndrade
What I thought was to use the
outerWidth()
and add or remove the class when the resolution is less than 767, but I can’t do it.– Guilherme Rigotti
@Leandrade In case I managed to add the class
owl-carousel
when the resolution is less than 768 the problem is that I can’t style Carousel to occupy the whole width and height of the div.– Guilherme Rigotti
If you’ve reached that point, edit the question and enter the code with Carousel working.
– LeAndrade
Face more details of how this and how you would like it to stay, which div wants to put the carousel etc...
– hugocsl