Using only CSS, show div on hover over

后端 未结 13 1115
时光取名叫无心
时光取名叫无心 2020-11-22 01:58

I would like to show a div when someone hovers over an element, but I would like to do this in CSS and not JavaScript. Do you know how this can be ach

13条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 02:26

    For me, if I want to interact with the hidden div without seeing it disappear each time I leave the triggering element (a in that case) I must add:

    div:hover {
        display: block;
    }
    

提交回复
热议问题