Multiple SVG icons in one file
How do I make an multiple svg icons in one file?
These icons all use the same source file. The correct icon ID is passed via a uri hash to the SVG. JS in the SVG parses location.hash and shows the correct icon.. What is a multiple svg icons in one file? How do you make a multiple svg icons in one file? This script and codes were developed by Niels Oeltjen on 08 September 2022, Thursday.
Multiple SVG icons in one file - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Multiple SVG icons in one file</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='https://elbone.github.io/cdn/codepen/codepen-default.css#def'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2>Multiple SVG icons in one file</h2>
<ul> <li> <object data="https://elbone.github.io/cdn/codepen/icon-2.svg#cloud"></object> <span>Cloud</span> </li> <li> <object data="https://elbone.github.io/cdn/codepen/icon-2.svg#rain"></object> <span>Rain</span> </li> <li> <object data="https://elbone.github.io/cdn/codepen/icon-2.svg#sun"></object> <span>Sun</span> </li>
</ul>
<p>These icons all use the same source file. <br /> The correct icon ID is passed via a uri hash to the SVG. <br />
JS in the SVG parses location.hash and shows the correct icon.</p>
<p>See the svg source <a href="https://raw.github.com/Elbone/elbone.github.com/master/cdn/codepen/icon-2.svg" target="blank">here</a></p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Multiple SVG icons in one file - Script Codes CSS Codes
ul { margin: 40px;
}
ul li { margin: 20px; display: inline-block;
}
ul li object { float: left; margin-right: 14px;
}
ul li span { line-height: 32px; display: block; float: left; color: #ccc; font-size: 24px;
}
Developer | Niels Oeltjen |
Username | NielsOeltjen |
Uploaded | September 08, 2022 |
Rating | 3 |
Size | 2,149 Kb |
Views | 72,864 |
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 |
Another nice loader | 2,267 Kb |
Expanding text links | 2,099 Kb |
SVG icons coloured using js and hash | 2,574 Kb |
Prose.io repo icon | 2,162 Kb |
Animated css matrix type | 3,484 Kb |
Semantic vertical centering | 2,394 Kb |
Loading animation | 2,298 Kb |
Sweet star loader | 2,228 Kb |
Paralax without plugin | 6,484 Kb |
Emoji selectors | 2,253 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 |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Compare resources on mobile sites | Gyusza | 3,226 Kb |
A Pen by Taylor Vowell | Taylorvowell | 5,962 Kb |
Scroll Arrow | Robooneus | 4,437 Kb |
Wrap_Test | Mscfourn | 7,503 Kb |
Expandable Left Side Bar with jQuery animate | Retrofuturistic | 2,483 Kb |
Fluid Layout with Float | Jxqr97 | 1,785 Kb |
Blog Concept - Single Post | Marionebl | 9,603 Kb |
Twitch | SarahDunlap | 2,937 Kb |
Google Maps API Ground Overlay | Boycetrus | 2,961 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!