Light up image on hover

前端 未结 6 2294
悲&欢浪女
悲&欢浪女 2021-02-07 21:18

Take a look at http://www.kickstarter.com.

When you hover over their logo, the image lights up. Is this effect doable without using a different image on hover?

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-07 21:34

    You may be able to use the css image filters, like this:

    img:hover {-webkit-filter: brightness(150%); }
    


    This sometimes looks funny and will only work in webkit browsers, but it's the best solution I could think of. It'll allow you to keep your blue background as well.

    Here's a jsfiddle showing the Kickstarter logo on a blue background.

    http://jsfiddle.net/62bCB/



    Cheers,

提交回复
热议问题