Monday, June 20, 2011

Add Animated Image Captions on Hover with CSS3 (No Javascript)

Posted by Unknown

DEMO tại ảnh dưới đây:


Khung cảnh thật kool ^^
Autum way in the forest.
Các bước thực hiện: ‘Edit HTML‘ ==> ]]>
Chèn Code dưới đây vào trước thẻ ]]>

/* Post images with CSS animated captions */
#post-image {
}


#figure {
position:relative;
float:left;
margin:10px;
overflow:hidden;
padding: 1px;
}


#figure:hover {
-moz-box-shadow:0 0 20px rgba(0,0,0,0.75);
-webkit-box-shadow:0 0 20px rgba(0,0,0,0.75);
box-shadow:0 0 20px rgba(0,0,0,0.75);
}


#figure .caption {
position:absolute;
bottom:0;
left:0;
opacity: 0.75;
margin-bottom:-115px;
-webkit-transition: margin-bottom;
-webkit-transition-duration: 400ms;
-webkit-transition-timing-function: ease-out;
-moz-transition-property: margin-bottom;
-moz-transition-duration: 400ms;
-moz-transition-timing-function: ease-out;
-o-transition-property: margin-bottom;
-o-transition-duration: 400ms;
transition: margin-bottom;
transition-duration: 400ms;
transition-timing-function: ease-out;
}


#figure:hover .caption {
margin-bottom:0px;
}


#post-image .caption {
width:100%;
height:90px;
padding:10px;
background:#111;
color:#fff;
font-family: Arial, Helvetica, sans-serif;
}
#post-image .caption b {
text-shadow: 0px 2px 0px #000;
}
#post-image .caption {
color: #ddd;
line-height: 24px;
font-size: 14px;
text-shadow: 0px 2px 0px #000;
}


Chèn Code sau cho mỗi ảnh khi Post bài:
<div id="post-image">
 <div id='figure'>
 <img src="#"/>
 <span class='caption'>
 <b>Image Title here</b>
 Image description goes here.
 </span>
 </div>
</div>
Labels:
Share this
http://2.bp.blogspot.com/--qM7OZGOVVQ/TuxDDxVMFKI/AAAAAAAADq8/Bk7tsIfbH1g/s1600/logo-affiliate-maketing+blog-pro.png

Post a Comment

Join 1675+ People Following Affiliate

Recen posts