<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Examples on HTML5 in 24 Hours</title>
    <link>https://www.html5in24hours.com/tags/examples/</link>
    <description>Examples on HTML5 in 24 Hours</description>
    <generator>Hugo</generator>
    <language>en-us</language><copyright>Jennifer Kyrnin</copyright><lastBuildDate>Fri, 09 Feb 2018 17:32:43 +0000</lastBuildDate>
    <atom:link href="https://www.html5in24hours.com/tags/examples/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Force a Download with HTML5</title>
      <link>https://www.html5in24hours.com/posts/force-a-download/</link>
      <pubDate>Fri, 09 Feb 2018 17:32:43 +0000</pubDate>
      <guid>https://www.html5in24hours.com/posts/force-a-download/</guid><description>&lt;p&gt;HTML5 is the greatest version of HTML ever! (Well, at least until the next awesome version comes out). I just learned how trivially easy it is to force downloads with HTML5.&lt;/p&gt;&#xA;&lt;p&gt;I was just trying to force a download of a PDF file because the customers need to sign it and send it back and it’s harder to do that online. I was going to use JavaScript, but decided that I’d do a quick search in case there was a better way.&lt;/p&gt;&#xA;&lt;h3 id=&#34;forcing-downloads-is-easyhtml5-to-the-rescue&#34;&gt;Forcing Downloads is Easy—HTML5 to the Rescue!&lt;/h3&gt;&#xA;&lt;p&gt;Not only is there a better way, but it’s trivially easy to implement. I just add the keyword &lt;code&gt;download&lt;/code&gt; to my anchor and &lt;strong&gt;BAM!&lt;/strong&gt; the browser will pop a dialog box. I haven’t tested it in a lot of browsers (or devices), but it’s still huge! I mean, as a fallback I can attach a download function only to links that have the &lt;code&gt;download&lt;/code&gt; keyword in them.&lt;/p&gt;&#xA;&lt;p&gt;Now my download links look like this:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;a href=&amp;#34;link to file&amp;#34; download=&amp;#34;&amp;#34;&amp;gt;Download the PDF&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I’m practically crying, I love HTML5 so much!!!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>I&#39;m loving SVG</title>
      <link>https://www.html5in24hours.com/posts/im-loving-svg/</link>
      <pubDate>Tue, 03 Jul 2012 19:48:31 +0000</pubDate>
      <guid>https://www.html5in24hours.com/posts/im-loving-svg/</guid><description>&lt;p&gt;One of the great things about HTML5 is that there is a &lt;a href=&#34;http://dev.w3.org/SVG/proposals/svg-html/svg-html-proposal.html&#34; title=&#34;Inline SVG in HTML5 and XHTML&#34;&gt;proposal in the W3C&lt;/a&gt;  to allow HTML5 and XHTML to include SVG inline in the documents. But what&amp;rsquo;s especially great is that if you&amp;rsquo;re using a modern browser (IE 9+, Firefox, Safari, Chrome, or Opera) you can embed SVG graphics in your HTML5 documents quickly and painlessly.&lt;/p&gt;&#xA;&lt;p&gt;I am loving SVG because I don&amp;rsquo;t have to learn anything new. I can simply create vector graphics in Adobe Illustrator and then embed the SVG code into my HTML like I would any other image or embedded element. I don&amp;rsquo;t even have to use any special tags to call it out, I just paste everything from the starting &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; tag to the closing &lt;code&gt;&amp;lt;/svg&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s an example. Note, I have added a &lt;code&gt;&amp;lt;switch&amp;gt;&lt;/code&gt; tag to call a fallback image if your browser doesn&amp;rsquo;t support inline SVG. This might result in you seeing the image twice, but I hope not. :-) If, when you right-click on this graph, you see a PNG image, then you&amp;rsquo;re seeing the fallback image.&lt;/p&gt;&#xA;&lt;p&gt;[iframe_loader src=&amp;ldquo;&lt;a href=&#34;https://www.html5in24hours.com/examples/inline-svg.html%22&#34;&gt;https://www.html5in24hours.com/examples/inline-svg.html&amp;quot;&lt;/a&gt; height=&amp;ldquo;310&amp;rdquo;]&lt;/p&gt;&#xA;&lt;p&gt;If you look at the HTML for that image, you&amp;rsquo;ll see a lot of &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;path fill=&amp;quot;#FED7B8&amp;quot; d=&amp;quot;M149.878,150.489l52.584,112.768c-62.28,29.041-136.311,2.097-165.353-60.184 c-14.521-31.14-15.905-62.854-4.154-95.141L149.878,150.489z&amp;quot;/&amp;gt;&lt;/code&gt; and other stuff that might look like gobbledygook, but it&amp;rsquo;s all SVG, and I didn&amp;rsquo;t have to come up with any of it. My program, Illustrator, did all the heavy lifting.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-ability-to-add-smooth-crisp-vector-images-to-my-html-pages-is-a-huge-benefit-to-using-html5-i-hope-that-we-see-more-of-this-type-of-graphics-in-the-future&#34;&gt;The ability to add smooth, crisp vector images to my HTML pages is a huge benefit to using HTML5. I hope that we see more of this type of graphics in the future.&lt;/h2&gt;&#xA;&lt;h3 id=&#34;comments&#34;&gt;Comments:&lt;/h3&gt;&#xA;&lt;h4&gt;&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;%22beth.kline@harley-davidson.com%22&#34;&gt;Beth&lt;/a&gt; - Jul 4, 2012&lt;/p&gt;&#xA;&lt;p&gt;Love getting your helpful hints.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h4&gt;&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;%22stanmil@internet.com.na%22&#34;&gt;Stan&lt;/a&gt; - Jul 0, 2012&lt;/p&gt;&#xA;&lt;p&gt;Just starting to learn into this Canvas/HTML5 &amp;amp; need more patience for better understanding. Sounds very positive &amp;amp; looks good! Thanks for this kick-start help. God bless! Stan from Windhoek&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h4&gt;&lt;/h4&gt;&#xA;&lt;p&gt;&lt;a href=&#34;%22bloggerbob91@yahoo.com%22&#34;&gt;Bob&lt;/a&gt; - Sep 2, 2012&lt;/p&gt;&#xA;&lt;p&gt;Stan, Canvas/HTML5 and SVG are different. Canvas is a raster image while SVG is a scalable image.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;</description>
    </item>
  </channel>
</rss>
