A Pen by Stan Williams on CodePen.
Created
December 18, 2025 21:15
-
-
Save stanwmusic/fc108df705d83841108213ad181204f3 to your computer and use it in GitHub Desktop.
Frame shadow effect with double box shadow
This file contains hidden or 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
| <img src="https://images.unsplash.com/photo-1765127585956-f80644ac99d2?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3NjU5OTI4NzZ8&ixlib=rb-4.1.0&q=80&w=400" alt="Christmas baubles on a tree with a golden glow"/> |
This file contains hidden or 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
| img { | |
| /* sizing & positioning */ | |
| display: block; | |
| box-sizing: border-box; | |
| max-width: calc(100% - 50px); | |
| margin: auto; | |
| /* frame effect */ | |
| border-radius: max(50px, 5vw); | |
| corner-shape: bevel; | |
| /* where supported, this creates angled corners instead of round */ | |
| border: 10px solid transparent; | |
| padding: max(20px, 2vw); | |
| background-image: repeating-linear-gradient(45deg, red 0 5px, gold 0 10px); | |
| background-clip: border-area; | |
| /* where supported, this will limit the gradient | |
| to the border so the padding area is transparent*/ | |
| box-shadow: | |
| 0 0 7px 3px black, | |
| /* regular shadow is outside border */ | |
| 0 0 7px 3px black inset; | |
| /* inset shadow is inside border */ | |
| } | |
| body { | |
| background: midnightBlue; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment