How to show button on div mouse hover

前端 未结 5 1466
暗喜
暗喜 2020-12-11 04:42

i want to show button on div hover. when i hover mouse on div then button show otherwise hide.

my button in divbutton div.

html

         


        
5条回答
  •  执笔经年
    2020-12-11 05:42

    first hide the button with transform property.

    button{
    transform:translate(100%,100%)
    //this will move the button right and buttom
    }
    

    then when you hover on div, you bring it back

    .divbutton:hover button{
         //class name should have been divButton
         transform:translate(0,0)}
    

提交回复
热议问题