Skip to content

Bug-Hunter-X/CSS--hover-issue-with-pointer-events--none-on-parent-y0ctb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CSS Hover Issue with pointer-events: none

This repository demonstrates a subtle bug in CSS concerning the interaction between the :hover pseudo-class and the pointer-events: none property. When a parent element has pointer-events: none set, hover events are not propagated to its children, preventing expected hover effects.

The bug.css file contains the problematic CSS code. The bugSolution.css provides a solution to work around this issue.

Reproduction

  1. Clone the repository.
  2. Open bug.html (or a similar HTML file incorporating the CSS) in a web browser.
  3. Observe that hovering over the parent element does not change the child's background color, despite the CSS rule intended to do so.

Solution

Refer to bugSolution.css for a solution that addresses this limitation.

About

CSS :hover pseudo-class not working on child element when parent has pointer-events: none.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages