.maincontainer
{
    width: 302px;
    height: 299px;
    margin: 10px;
    float: left; /* stack each div horizontally */
    
   

}

img
{
   border-radius: 10px;
   background-color:#002233;
   border-style:2px solid  black;
   
  
}

.back h2
{
    position: absolute;
}

.back p
{ 
     text-align:center;
    position: absolute;
    top: 50px;
    font-size: 15px;
   
}

.front h5
{
    margin-left:35px;
    position: absolute;
    text-align:center;
    padding:0;
    top: 200px;
    color: #000;
}


/* style the maincontainer class with all child div's of class .front */
.maincontainer > .front
{
    position: absolute;
    transform: perspective(600px) rotateY(0deg);
    
    width: 302px;
    height: 290px;
    
    backface-visibility: hidden; /* cant see the backside elements as theyre turning around */
    transition: transform .5s linear 0s;
}

/* style the maincontainer class with all child div's of class .back */
.maincontainer > .back
{
    position: absolute;
    transform: perspective(600px) rotateY(180deg);
    background:   rgb(41, 153, 194);
    color:white;
    width: 302px;
    height: 290px;
    border-radius: 10px;
    padding: 5px;
    backface-visibility: hidden; /* cant see the backside elements as theyre turning around */
    transition: transform .5s linear 0s;
}

.maincontainer:hover > .front
{
    transform: perspective(600px) rotateY(-180deg);
}

.maincontainer:hover > .back
{
    transform: perspective(600px) rotateY(0deg);
}

@media (max-width:1000px){
    .maincontainer {
      margin-left:70px;
      margin-right: 0!important;
      width: 50%;
      float: left;
    }
  }  