First up, the HTML markup. Without CSS enabled, you just get two images. Remember to add alt text for production use.
<div id="cf"> <img class="bottom" src="/tests/images/Stones.jpg" /> <img class="top" src="/tests/images/Summit.jpg" /> </div>
Then the CSS:
#cf {
position:relative;
height:281px;
width:450px;
margin:0 auto;
}
#cf img {
position:absolute;
left:0;
-webkit-transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-o-transition: opacity 1s ease-in-out;
-ms-transition: opacity 1s ease-in-out;
transition: opacity 1s ease-in-out;
}
#cf img.top:hover {
opacity:0;
}
Please add any questions/corrections/extra info below. Please be courteous to other users.
blog comments powered by Disqus