mcdufrechou Posted October 15, 2023 Share Posted October 15, 2023 For years, I've used css for a hover state effect that removes the thumbnail and reveals the gif playing behind it. It stopped working recently, and I can't figure out why. My portfolio is www.maxdufrechou.com. No problem with the gifs I can tell, but the hover state is broken. Nothing happens when the cursor is over the thumbnails. Here's the Shaq thumbnail for example: /*Carnival CFO Shaq*/ #block-aa4e504464cfdcdbba23 { background-image: url(https://static1.squarespace.com/static/6313ad8515db3003bd319b38/t/635ac308deb2fd44202ff940/1666892556596/GIF_Carnival_Shaq.gif); background-size: cover; background-position: center; } #block-aa4e504464cfdcdbba23:hover img { display: none; } Any thoughts? Link to comment
Web_Solutions Posted October 15, 2023 Share Posted October 15, 2023 36 minutes ago, mcdufrechou said: For years, I've used css for a hover state effect that removes the thumbnail and reveals the gif playing behind it. It stopped working recently, and I can't figure out why. My portfolio is www.maxdufrechou.com. No problem with the gifs I can tell, but the hover state is broken. Nothing happens when the cursor is over the thumbnails. Here's the Shaq thumbnail for example: /*Carnival CFO Shaq*/ #block-aa4e504464cfdcdbba23 { background-image: url(https://static1.squarespace.com/static/6313ad8515db3003bd319b38/t/635ac308deb2fd44202ff940/1666892556596/GIF_Carnival_Shaq.gif); background-size: cover; background-position: center; } #block-aa4e504464cfdcdbba23:hover img { display: none; } Any thoughts? Which image? Can you send me screenshot? If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks MD Rofik Website Designer and Digital Marketer ☕Am I helpful? Want to offer me a coffee? ✉ Send me a message if needed any help. I'll try to reply as soon as possible. Link to comment
mcdufrechou Posted October 15, 2023 Author Share Posted October 15, 2023 So below is screen grab of the homepage to my portfolio. Each thumbnail takes you to this project's page. Also attached is the gif 'CFO Shaq' as an example. It's meant to work so that when you hover over the thumbnail jpeg the jpeg goes away and reveals the gif behind it. Each thumbnail is coded for a hover state of 'none' and to show its relating gif. Never been a problem before. Didn't make any changes to the site or css either. Link to comment
mcdufrechou Posted October 15, 2023 Author Share Posted October 15, 2023 I think I found a solution. Putting it here in case anyone else has this problem (or in case I'm doing something that's gonna cause even more problems later) I had the hover state as #[the block id]:hover img { display: none; } And I changed it to: #[the block id]:hover img { opacity: 0; } Don't understand why 'display: none' no longer works, but the zeroed out opacity seems to do it. tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment