How to make background image blur on link hover?

前端 未结 3 1800
眼角桃花
眼角桃花 2021-01-24 06:35

I\'d like to make my background image blur for let\'s say 5px when you hover the link with a mouse cursor. Is there any simple way to make this happen? I got a bit entangled wit

3条回答
  •  一向
    一向 (楼主)
    2021-01-24 07:25

    #pic a:hover  {  
        background: url(<-- insert blurred image here -->);
    }` 
    

    This is the easiest way to create the effect you are looking for. As I'm sure you know, the issue is one of scope. You cannot (to my knowledge) set the background of a parent element from a child element without a JS workaround.

提交回复
热议问题