Adding Shadow to SVG elements
How do I make an adding shadow to svg elements?
This isn't working - please leave a comment with suggestions or links to working forks of this pen.What I need to do is change color & add a shadow (glow effect) to the path element when you hover on the SVG. The filter: drop-shadow() only works when applied to the SVG itself, but in production, I intend to animate this property individually for several paths in an SVG file, so I really need to get this working on the g or path level. Thanks in advance for your help!. What is a adding shadow to svg elements? How do you make a adding shadow to svg elements? This script and codes were developed by James Steinbach on 05 November 2022, Saturday.
Adding Shadow to SVG elements - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Adding Shadow to SVG elements</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="text">Lorem Ipsum, etc.</div>
<div class="svg-self"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 47.6 59.8" enable-background="new 0 0 47.6 59.8"><path id="glow" fill="none" stroke-width="2" stroke-miterlimit="10" stroke="#4dbeee" d="m.8 34.7s8.7-12.4 7.5-24.3l5.2 8.9 6.1-14.4v15.9l15.4-10.4-7 16.6 16.8 1.2-19 14.5 12.7 2.2-26 14"/></svg>
</div>
<div class="svg-path"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 64" enable-background="new 0 0 47.6 59.8"> <filter id="blur-filter" x="-2" y="-2" width="200" height="200"> <feGaussianBlur in="SourceGraphic" stdDeviation="2" /> </filter> <path id="glow" fill="none" stroke-width="2" stroke-miterlimit="10" stroke="#4dbeee" d="m.8 34.7s8.7-12.4 7.5-24.3l5.2 8.9 6.1-14.4v15.9l15.4-10.4-7 16.6 16.8 1.2-19 14.5 12.7 2.2-26 14"/> <path id="color" fill="none" stroke-width="2" stroke-miterlimit="10" stroke="#4dbeee" d="m.8 34.7s8.7-12.4 7.5-24.3l5.2 8.9 6.1-14.4v15.9l15.4-10.4-7 16.6 16.8 1.2-19 14.5 12.7 2.2-26 14"/> </svg>
</div>
</body>
</html>
Adding Shadow to SVG elements - Script Codes CSS Codes
body { background: #222; color: white;
}
div { margin: 2em; width: 10em; height: 10em; display: inline-block; vertical-align: top;
}
.text { display: block; font-size: 2em; font-family: sans-serif; height: auto;
}
.text:hover,
.svg-path svg:hover #glow { stroke: white; -webkit-filter: url(#blur-filter); filter: url(#blur-filter);
}
.svg-path svg:hover #color { stroke: white;
}
Developer | James Steinbach |
Username | jdsteinbach |
Uploaded | November 05, 2022 |
Rating | 4 |
Size | 2,501 Kb |
Views | 12,144 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Sass Geometric Pattern Generator | 2,020 Kb |
LOTR-ish Ring | 4,284 Kb |
Using a gradient for a border | 2,138 Kb |
Parallax-ish Sliding Content | 2,748 Kb |
FlexBox Gallery | 2,205 Kb |
Moving Polygons | 3,143 Kb |
Slip-Scroll - No JS | 5,556 Kb |
Flip Card | 2,343 Kb |
Testing Newer Width Values | 2,449 Kb |
Animated Form Focus | 2,968 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Ocean | Gordonnl | 2,817 Kb |
Canvas stripes | Adrianparr | 1,948 Kb |
Firefox Breakout Guide | Quincysoeliman | 2,576 Kb |
Slim Grid SASS SCSS v3.2 | Thesturs | 4,709 Kb |
A Pen by Sooba | Sooba | 2,516 Kb |
Incremental game | Eprouver | 5,868 Kb |
Cofee and sugar | Tripack | 2,094 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
Css3 slide | Nakome | 3,190 Kb |
Vertical Pan Hammer.js example | Jtangelder | 2,144 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!