Transition only for the border on hover, but not for background

后端 未结 2 715
感动是毒
感动是毒 2021-02-07 12:29

Here I have some CSS:

    #image-edges-beneath:hover{
    background-color: blue;
    }

    #image-edges:hover{
      background-color: blue;
          


        
2条回答
  •  广开言路
    2021-02-07 13:00

    What you need to do is set which property you want to transistion properly. Currently you have it as "all" but it needs to be either "background-color" or "border-color" based on which you want to be transitioned.

     transition: border-color 1s ease;  
    

    http://jsfiddle.net/u3Ahk/

提交回复
热议问题