JSFiddle - React, Tailwind, and code Playground
by gricha2380
HTML
<div class="bigHolder">
<a class="less-logo-new" href="http://apple.com">
<img src="http://gregorrichardson.com/less/images/logo1.png">
<img src="http://gregorrichardson.com/less/images/logo2.png">
</a>
</div>
CSS
.bigHolder{
background-color: #222;
}
.less-logo-new{
//position: relative;
width: 200px;
height: 40px;
display:block;
}
.less-logo-new > img{
display: block;
width: 192px;
height: 36px;
position: absolute;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.less-logo-new > img:nth-child(1){
filter: alpha(opacity=100); /* IE stuff */
opacity: 1;
z-index: 2;
}
.less-logo-new > img:nth-child(2){
filter: alpha(opacity=0); /* IE stuff */
opacity: 0;
z-index: 1;
}
/* hover */
.less-logo-new:hover > img:nth-child(1){
filter: alpha(opacity=0);
opacity: 0;
z-index: 1;
}
.less-logo-new:hover > img:nth-child(2){
filter: alpha(opacity=100);
opacity: 1;
z-index: 2;
}