CSS for hover that includes all child elements

后端 未结 4 647
走了就别回头了
走了就别回头了 2020-12-30 22:05

I have a draggable div element with a hover style. This works fine, but the div contains some form elements (label, input). The problem is that when the mouse is over these

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-30 22:42

    At least 2 ways of doing it:

    • hover states for each child, either explicitly or with * selector, as suggested by garrow .class *:hover
    • cascade hover state to children .class:hover *

    There are probably others

提交回复
热议问题