.textWithImage{
    position:relative;
    width:300px;
    height:300px;
    float:left;
    margin:4px;
    background-size: auto 100%;
    background-position:center;
    background-repeat: no-repeat;
    transition:0.5s;
    overflow: hidden;
    border-radius:4px;
    box-shadow:0 0 4px #000;
  }
  
  .textWithImage:hover{
    background-size: auto 110%;
  }
  
.textWithImage:before{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    transform:translateY(100%);
    background-color:#0003;
    color:#fff;
    padding:0 8px;
    content:attr(data-title);
    transition:0.5s 0.1s;
    color:#fff;
    font-weight:bold;
    font-size:1.5em;
    text-align: center;
}

.textWithImage:after{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    color:#fff;
    padding:8px;
    content:attr(data-text);
    transition:0.5s;
    padding-top:3em;
    margin-top: 23px;
    transform:translateY(100%);
    opacity:0;
    text-align: center;
  }
  
.textWithImage:hover:after{
    transform:translateY(0);
    transition:0.5s 0.1s;
    opacity:1;
  }

.textWithImage:hover:before{
    transform:translateY(0);
    padding:8px;
    background-color:rgba(0,0,0,0.6);
    transition:0.5s;
}
