Is there a CSS “:drop-hover” pseudo-class?

前端 未结 2 1069
眼角桃花
眼角桃花 2021-02-11 16:35

Saying I have an input type=\"file\" field. One can drop a file on this input(like in Firefox) instead of clicking \"browse\" and selecting the file.

2条回答
  •  孤街浪徒
    2021-02-11 17:19

    UPDATE: Thanks to @Renato's comment, according to https://github.com/w3c/csswg-drafts/issues/2257, the drop pseudo-class has been dropped now.


    There is :drop and :drop() pseudo-class, which is currently in Working Draft status.

    According to http://css4.rocks/selectors-level-4/drag-and-drop-pseudo-class.php, the browser support is not good.

    For "file being dropped is not accepted" case, :drop(invalid active) is expected to work, in future.

提交回复
热议问题