Is there a way to prevent wrapping of a column so that when I hover over the first column, the last column displays half out of the container?
I attempted to achieve this by setting the 25%
to flex: 0 0 50%;
in my column when hovering on the box-hover
class. While this works fine, the last column still wraps.
My goal is for the last column to display partially outside the container when hovering over the box-hover
, showing half of it and hiding the other half.
I have included an image depicting what I am aiming for. Thank you in advance.
I desire:
https://i.sstatic.net/hazJi.jpg
Here is my code snippet:
.main-wraper {
padding: 150px 0;
background-color: #7070702b;
}
.box {
height: 345px;
background-color: #36495E;
margin-bottom: 30px;
}
span {
position: absolute;
bottom: 0;
height: 90px;
width: 100%;
color: #fff;
text-align: center;
background-color: #5195CE;
}
.box-hover {
transition: ease-in-out 0.5s;
}
.box-hover:hover {
-ms-flex: 0 0 50%;
flex: 0 0 50%;
max-width: 50%;
}
.box-hover span {
background-color: #89c440;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<section class="main-wraper">
<div class="container">
<div class="row">
<div class="col-md-3 box-hover">
<div class="box position-relative">
<span class="d-flex flex-column justify-content-center">Lorem Ipsum is simply dummy</span>
</div>
</div>
<div class="col-md-3">
<div class="box position-relative">
<span class="d-flex flex-column justify-content-center">Lorem Ipsum is simply dummy</span>
</div>
</div>
<div class="col-md-3">
<div class="box position-relative">
<span class="d-flex flex-column justify-content-center">Lorem Ipsum is simply dummy</span>
</div>
</div>
<div class="col-md-3">
<div class="box position-relative">
<span class="d-flex flex-column justify-content-center">Lorem Ipsum is simply dummy</span>
</div>
</div>
</div>
</div>
</section>