zigzag Posted November 26, 2020 Posted November 26, 2020 I am trying to get a change image on hover which I have successfully done, but when I then add another image, it changes the images to the first blocks images. Even though the URL's are different. Some research has shown that I may need to change the class/ID's but no idea how to do this. This is the code I am using <center> <!DOCTYPE html> <html lang="en"> <head> <title>Change Image on Hover in CS</title> <style type="text/css"> .card { width: 375px; height: 350x; background: url("https://images.squarespace-cdn.com/content/v1/551ecefbe4b08b18b56e5701/1606340837792-FSLLORGW05SJJ8YIVUFN/ke17ZwdGBToddI8pDm48kCMWMBFcqQftRz-JqZZoIB5Zw-zPPgdn4jUwVcJE1ZvWEtT5uBSRWt4vQZAgTJucoTqqXjS3CfNDSuuf31e0tVFI99ncPZu898P4WAmVYNBp8mgB1qWbp5RirnU_Xvq-XCb8BodarTVrzIWCp72ioWw/Untitled+design+%287%29.png?format=500w") no-repeat; margin: 30px; } .card:hover { background: url("https://images.squarespace-cdn.com/content/v1/551ecefbe4b08b18b56e5701/1606340808469-EODV0QGQMCXLE4WCPIL8/ke17ZwdGBToddI8pDm48kCMWMBFcqQftRz-JqZZoIB5Zw-zPPgdn4jUwVcJE1ZvWEtT5uBSRWt4vQZAgTJucoTqqXjS3CfNDSuuf31e0tVFI99ncPZu898P4WAmVYNBp8mgB1qWbp5RirnU_Xvq-XCb8BodarTVrzIWCp72ioWw/Jess+Bowen.png?format=500w") no-repeat; } </style> </head> <body> <div class="card" ></div> </body> </html>
tuanphan Posted December 5, 2020 Posted December 5, 2020 You can use this code to achieve image change on hover. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.