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 |
A Pen by James Steinbach | 2,612 Kb |
Sphere Spin | 4,204 Kb |
Sass Geometric Pattern Generator | 2,020 Kb |
Using a gradient for a border | 2,138 Kb |
Animated Form Focus | 2,968 Kb |
Flip Card | 2,343 Kb |
Gradient Hover Effect | 2,212 Kb |
CSS Variables | 4,759 Kb |
Testing Newer Width Values | 2,449 Kb |
LOTR-ish Ring | 4,284 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 |
HTML5 Breakout | Jaysalvat | 4,873 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
Responsive slide | Thorien | 2,400 Kb |
Login with flip 3d animation | Mariusbalaj | 3,014 Kb |
Cofee and sugar | Tripack | 2,094 Kb |
Pomodoro Clock | Osycon | 3,705 Kb |
Custom Select Element | Agrayson | 3,616 Kb |
Day 1 - Portfolio | Chpecson | 3,532 Kb |
Pure CSS Menu | Bronsrobin | 3,321 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!