Image Hover Effects
Image Hover Effects
by Roshan Karunarathna
HTML
<div class="grow pic">
<img src="https://static.pexels.com/photos/34489/girl-child-pretty-person-large.jpg" alt="">
</div>
<div class="shrink pic">
<img src="https://static.pexels.com/photos/24213/pexels-photo-large.jpg" alt="">
</div>
<div class="sidepan pic">
<img src="https://static.pexels.com/photos/19936/breakfast-orange-lemon-oranges-medium.jpg" alt="">
</div>
<div class="vertpan pic">
<img src="https://static.pexels.com/photos/35176/pexels-photo-large.jpg" alt="">
</div>
<div class="tilt pic">
<img src="https://static.pexels.com/photos/33325/girl-person-human-female-medium.jpg" alt="">
</div>
<div class="morph pic">
<img src="https://static.pexels.com/photos/36240/pexels-photo-medium.jpg" alt="">
</div>
<div class="focus pic">
<img src="https://static.pexels.com/photos/9477/pexels-photo-medium.jpeg" alt="">
</div>
<div class="blur pic">
<img src="https://static.pexels.com/photos/34846/pexels-photo-medium.jpg" alt="">
</div>
<div class="bw pic">
<img src="https://static.pexels.com/photos/14621/Warsaw-at-night-free-license-CC0-medium.jpg" alt="">
</div>
CSS
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
body {
background: #333;
}
.pic {
border: 10px solid #fff;
float: left;
height: 300px;
width: 300px;
margin: 20px;
overflow: hidden;
-webkit-box-shadow: 5px 5px 5px #111;
box-shadow: 5px 5px 5px #111;
}
CSS
/*GROW*/
.grow img {
height: 300px;
width: 300px;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.grow img:hover {
width: 400px;
height: 400px;
}
/*GROW*/
.grow img {
height: 300px;
width: 300px;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.grow img:hover {
width: 400px;
height: 400px;
}
/*SHRINK*/
.shrink img {
height: 400px;
width: 400px;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.shrink img:hover {
width: 300px;
height: 300px;
}
/*SHRINK*/
.shrink img {
height: 400px;
width: 400px;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.shrink img:hover {
width: 300px;
height: 300px;
}
/*SIDEPAN*/
.sidepan img {
margin-left: 0px;
-webkit-transition: margin 1s ease;
-moz-transition: margin 1s ease;
-o-transition: margin 1s ease;
-ms-transition: margin 1s ease;
transition: margin 1s ease;
}
.sidepan img:hover {
margin-left: -200px;
}
/*VERTPAN*/
.vertpan img {
margin-top: 0px;
-webkit-transition: margin 1s ease;
-moz-transition: margin 1s ease;
-o-transition: margin 1s...