Created
July 21, 2020 14:47
-
-
Save PaulloClara/9f7bd0b3c25579c5059788665a2a543d to your computer and use it in GitHub Desktop.
simple example of using pointer events in css.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<main> | |
<div></div> | |
<div></div> | |
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main { | |
pointer-events: none; | |
} | |
main > div { | |
width: 20px; | |
height: 20px; | |
background: #000; | |
} | |
main > div:first-child { | |
margin-bottom: 2px; | |
pointer-events: none; | |
} | |
main > div:last-child { | |
pointer-events: auto; | |
} | |
main:hover > div:first-child { | |
background: #f00; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment