I DON'T KNOW CODING ; NEED HELP WITH THIS

ProGIG

Regular Member
Joined
Apr 12, 2019
Messages
377
Reaction score
42
I wanna know how I can change images on hovering over them. I got this code from the web but it does not work properly, and I wanna add a fade effect too in the transition. Would appreciate if anyone can help with this. Thanks :)

Code:
div {
    background: url('http://dummyimage.com/100x100/000/fff');
}
div:hover {
    background: url('http://dummyimage.com/100x100/eb00eb/fff');
}
 
As alex said just do:

Code:
div {
    background: url('http://dummyimage.com/100x100/000/fff');
    transition: background 0.5s;
}
div:hover {
    background: url('http://dummyimage.com/100x100/eb00eb/fff');
}

Change the 0.5 accordingly to how many seconds you want the transition from one photo to the other to take effect
 
Back
Top