.tidings {
width: 30%;
float: left;
margin: 0 3%;
}
.tidingsimg:before{
content: url("https://s4.postimg.org/466igrsgt/Tidingsrune.png");
position: relative;
transition: opacity 1s ease;
-webkit-transition: opacity 1s ease;
}
.tidingsimg:after{
content: url("https://s12.postimg.org/83p4b0ubx/Tidingsrune2.png");
position:absolute;
top: 0;margin-top: 10px;
opacity:0;
transition: opacity 1s ease;
-webkit-transition: opacity 1s ease;
}
.tidingsimg:hover:after{
opacity:1;
}
.tidingsimg:hover:before{
opacity:0;
}
<div class="tidings"><a href="http://hvalla.deviantart.com" class="tidingsimg"></a></div>
I am currently experimenting with a smooth image transition effect on my website using the CSS content: url
property. While I've managed to switch between images, I'm struggling to make the change appear seamless. Is there a way to achieve this transition smoothly through the use of the content
attribute?
Check out this JSFiddle for a demo of what I have implemented so far.