Created
November 3, 2022 21:23
-
-
Save newtone/c1eb3dd03eab445c25d3e7ec730965a4 to your computer and use it in GitHub Desktop.
https://css-tricks.com/a-pure-css-gallery-focus-effect-with-not/
https://jsbin.com/hinikinete/2/edit?html,css,output
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
section { | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
gap: 1rem; | |
} | |
article { | |
border: 1px solid navy; | |
aspect-ratio: 1 / 1; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
section { | |
visibility: hidden; | |
} | |
section article { | |
visibility: visible; | |
} | |
section:hover article { | |
opacity: 0.2; | |
} | |
section:hover article:hover { | |
opacity: 1; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<section> | |
<article>a</article> | |
<article>b</article> | |
<article>c</article> | |
<article>d</article> | |
<article>e</article> | |
</section> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment