<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Speyll&#39;s Writing Endeavors - Webdev</title>
    <subtitle>Welcome to Speyll&#39;s corner of the internet where creativity thrives in a free-spirited oasis, explore the vast realm of technology and gaming. artist wannabe, open-source enthusiast, Windows and Linux IT, Gain valuable insights and tips to optimize your digital experiences. Delve into captivating game reviews and industry trends. Occasionally, get a glimpse of the person behind the screen as I share anecdotes from my life. take your digital lifestyle to new heights. Join me on this journey as we embrace web creativity and carve our distinctive space in the vast internet&#39;s sea.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://speyllsite.pages.dev/tags/webdev/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://speyllsite.pages.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2023-10-22T00:00:00+00:00</updated>
    <id>https://speyllsite.pages.dev/tags/webdev/atom.xml</id>
    <entry xml:lang="en">
        <title>Declutter your HTML SVG Icons Paths</title>
        <published>2023-10-22T00:00:00+00:00</published>
        <updated>2023-10-22T00:00:00+00:00</updated>
        
        <author>
          <name>Speyll</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://speyllsite.pages.dev/blog/declutter-html-svg-icons/"/>
        <id>https://speyllsite.pages.dev/blog/declutter-html-svg-icons/</id>
        
        <content type="html" xml:base="https://speyllsite.pages.dev/blog/declutter-html-svg-icons/">&lt;p&gt;If you’ve ever encountered websites where icons clutter the HTML, making it resemble a digital hoarder’s treasure trove, there’s a more elegant solution. In this post, we’ll explore how to add SVG icons to your website while maintaining a streamlined and organized HTML structure.&lt;/p&gt;
&lt;h2 id=&quot;the-art-of-organized-svg-icons&quot;&gt;The Art of Organized SVG Icons&lt;/h2&gt;
&lt;p&gt;Here’s how you can seamlessly integrate SVG icons into your web design without sacrificing the cleanliness of your HTML:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create an Icons SVG File:&lt;/strong&gt; Begin by creating an &lt;code&gt;icons.svg&lt;/code&gt; file that serves as a dedicated repository for your icons. This file will keep your icons organized and your code uncluttered.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define Your Icons:&lt;/strong&gt; Within &lt;code&gt;icons.svg&lt;/code&gt;, define each icon using the &lt;code&gt;&amp;lt;symbol&amp;gt;&lt;/code&gt; tag. Assign them unique IDs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;xml&quot;&gt;&amp;lt;svg xmlns=&amp;quot;http://www.w3.org/2000/svg&amp;quot;&amp;gt;
  &amp;lt;symbol id=&amp;quot;calendar&amp;quot; viewBox=&amp;quot;0 0 24 24&amp;quot;&amp;gt;
    &amp;lt;!-- Your icon path here --&amp;gt;
  &amp;lt;/symbol&amp;gt;
&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reference Icons in Your HTML:&lt;/strong&gt; Now, it’s time to utilize these icons in your HTML without cluttering your code. Employ the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt; tags to insert the icons as needed, referencing the &lt;code&gt;icons.svg&lt;/code&gt; file and the icon’s ID.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;html&quot;&gt;&amp;lt;svg class=&amp;quot;icons&amp;quot;&amp;gt;&amp;lt;use href=&amp;quot;icons.svg#calendar&amp;quot;&amp;gt;&amp;lt;/use&amp;gt;&amp;lt;/svg&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In summary, By structuring your website in this manner, you maintain a sleek, organized HTML that’s free from the clutter of icon code, while still enjoying the benefits of SVG icons.&lt;/p&gt;
</content>
        
    </entry>
</feed>
