You can use box-shadow , perhaps:
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 10px #0f0; }
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 10px #0f0; }
<div id="something"></div>
This has the advantage that it overlays the background image of the div , but it is of course blurry (as you would expect from the box-shadow property). To create density shadows, you can add additional shadows, of course:
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 20px #0f0, inset 0 0 20px #0f0, inset 0 0 20px #0f0; }
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 20px #0f0, inset 0 0 20px #0f0, inset 0 0 20px #0f0; }
<div id="something"></div>
Edited because I realized that I was an idiot, and forgot to offer the simplest solution first, which uses a child otherwise-empty to apply borders on the background:
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; padding: 0; position: relative; } #something div { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border: 10px solid rgba(0, 255, 0, 0.6); }
<div id="something"> <div></div> </div>
Edited after @CoryDanielson comment below :
jsfiddle.net/dPcDu/2 you can add a 4 px parameter for box-shadow , which will distribute and will more easily reflect its images.
#something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 0 10px rgba(0, 255, 0, 0.5); }
<div id="something"></div>
David Thomas Dec 09 2018-11-11T00: 00Z
source share