Can you add a non-square drop shadow to PNG content with CSS?
It's definitely possible.
Using filters, sample:
img {
-webkit-filter: drop-shadow(5px 5px 5px #222);
filter: drop-shadow(5px 5px 5px #222);
}
How to make a rounded drop shadow on a png image
for rounded drop shadow you can use radial-gradient in background with transparent image.
original image used in snippet is original image
Please refer snippet.
body{background-color: black}img {
/* For browsers that do not support gradients */ background-image: radial-gradient(circle, white, black, black); padding: 50px;}
<body>
<img src="https://vignette.wikia.nocookie.net/fantendo/images/a/ae/250px-Captain_Falcon_SSB4.png" /></body>
box shadow issue with transparent parts of an image
You can use filter
with drop-shadow
.
Check out the supported browsers in this list.
.framed-image { background: url("https://cdn.pbrd.co/images/HfNQr1M.png") no-repeat; background-size: cover; padding: 18px; object-fit: cover;}
.image-menu { width: 300px; height: 200px; background-size: 100% 100% !important; filter: drop-shadow(0 3px 8px rgb(136, 136, 136));}
<div class="image-menu-parent"> <img class="framed-image image-menu" src="http://placehold.it/1/365f83"></div>
Possible to create a css shadow on transparent background PNG image?
If you load the image in to a canvas context you can do this.
good clean source here:
http://philip.html5.org/demos/canvas/shadows/various.html
Related Topics
How to Make the Items in the Last Row Consume Remaining Space in CSS Grid
Css: Fixed Position on X-Axis But Not Y
How to Create Equal Height Columns in Pure Css
Css Text-Transform Capitalize on All Caps
Is !Important Bad For Performance
Aligning Two Divs Side-By-Side
How Does the CSS Specificity Work
Bootstrap 4 Change Breakpoints
Google Drive CSS/Js Returns 404 Error
CSS Transition Auto Height Not Working
Content Url Does Not Display Image on Firefox Browser
Why Does 'Overflow: Auto' Clear Floats? And Why Are Clear Floats Needed
Do I Need to Wrap Quotes Around Font Family Names in Css
Display:Inline VS Display:Block
How Does #Iefix Solve Web Fonts Loading in IE6-IE8