I have three unique "cards" that I want to display horizontally and center on the page without using the bootstrap card class. Currently, I am attempting to assign each of them a width of .col-lg-4
within an outer div set to full width. However, they are still aligned left due to the float property. Removing the left float results in vertical alignment. How can I correctly apply the columns in this scenario?
<div class="container">
<div class="flip-cards col-lg-12">
<div class="info-card col-lg-4">
<div class="front">
<h3>Header</h3>
</div>
<div class="back">
<p>Title</p>
<h6>lorem ipsum</h6>
</div>
</div>
<div class="info-card col-lg-4">
<div class="front">
<h3>Header</h3>
</div>
<div class="back">
<p>Title</p>
<h6>lorem ipsum</h6>
</div>
</div>
<div class="info-card col-lg-4">
<div class="front">
<h3>Header</h3>
</div>
<div class="back">
<p>Title</p>
<h6>lorem ipsum</h6>
</div>
</div>
</div>
</div>
CSS
.container{
background-color: #eee;
}
.flip-cards .info-card {
float: left;
margin: 2% 1% 0% 1%;
padding: 5% 0% 5% 0%;
position: relative;
-webkit-perspective: 600px;
}
.flip-cards .info-card:hover .back {
-webkit-transform: rotateY(0);
}
.flip-cards .info-card:hover .front {
-webkit-transform: rotateY(180deg);
}
.flip-cards .info-card .front, .flip-cards .info-card .back {
transition: -webkit-transform 1s;
-webkit-transform-style: preserve-3d;
-webkit-backface-visibility: hidden;
}
.flip-cards .info-card .front {
background-color: #fff;
overflow: hidden;
width: 200px;
height: 170px;
position: absolute;
opacity: .5;
}
.flip-cards .info-card .front h3 {
text-decoration: underline;
padding: 10px;
text-align: left;
color: #6633cc;
}
.flip-cards .info-card .back {
background-color: #6633cc;
width: 200px;
height: 170px;
-webkit-transform: rotateY(-180deg);
}
.flip-cards .info-card .back p {
color: #fff;
padding: 7px 0px 0px 10px;
font-size: 10px;
}
.flip-cards .info-card .back h6 {
font-weight: 400;
color: #fff;
position: absolute;
text-align: left;
padding: 0px 10px 10px 10px;
bottom: 0;
}
.flip-cards .info-card .back h6 a {
color: #fff;
text-decoration: underline;
}
@media (max-width: 400) {
.flip-cards {
margin-left: -3%;
}
.card-outer-wrapper {
height: 260px;
margin-bottom: 40px;
max-width: 100vw;
overflow-x: scroll;
overflow-y: hidden;
position: relative;
}
.card-outer-wrapper .card-wrapper {
overflow-x: scroll;
width: 200%;
}
}
JSFIDDLE: https://jsfiddle.net/sxLodk6r/