Jumat, 18 Juli 2014

multihover img

thumbnail

 <style>
 /* The container and the image */
  div.multi-hover {
    overflow: hidden;
    position: relative;
    vertical-align: middle;
    width: 100%;
    height: 358px;
    line-height: 358px;
  }
  div.multi-hover img {width: 100%;}

/* The texts that, by default, are hidden */
  div.multi-hover span {
    color: #FFF;
    font-size: 32px;
    font-weight: bold;
    height: 100%;
    opacity: 0; 
    position: absolute;
    text-align: center;
    transition: all 0.3s linear 0s;
    width: 100%;
  }

/* And this is what will generate the effect */
  div.multi-hover span:nth-child(1) { /* right */
    background: none repeat scroll 0 0 rgba(255, 189, 36, 0.6);
    left: 90%;
    top: 0;
  }
  div.multi-hover span:nth-child(2) { /* top */
    background: none repeat scroll 0 0 rgba(106, 170, 255, 0.6);
    left: 0;
    top: -80%;
  }
  div.multi-hover span:nth-child(3) { /* left */
    background: none repeat scroll 0 0 rgba(204, 87, 166, 0.6);
    left: -90%;
    top: 0;
  }
  div.multi-hover span:nth-child(4) { /* bottom */
    background: none repeat scroll 0 0  rgba(97, 181, 115, 0.6);
    left: 0;
    top: 80%;
  }
  div.multi-hover span:hover {opacity: 1;}
  div.multi-hover span:nth-child(2n+1):hover {left: 0;}
  div.multi-hover span:nth-child(2n):hover {top: 0;}
</style>



<div class=multi-hover>
  <span>Hover Right</span>
  <span>Hover Top</span>
  <span>Hover Left</span>
  <span>Hover Bottom</span>
  <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxmTNUoQv5ErSEuCV81aplj3DlHqWvPzzLIzpqrnaFVZizC-Tw_hjoslFFv6bnu3gka1_Z_duOfNDjEkteS5z8GDD211ljYZcC1PsiN_WvZ90cUNPiiyI1Y7RQLplOr-eAcebz5dWo2uoQ/s1600/IMG_0093.JPG">
</div>
 



Tambahkan komentar Komentator

Konversi KodeOOT

Terima kasih telah berkomentar