<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>HTML on yozy//NET</title>
    <link>https://yozy.net/tags/html/</link>
    <description>Recent content in HTML on yozy//NET</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 03 Jan 2018 10:20:50 +0100</lastBuildDate>
    <atom:link href="https://yozy.net/tags/html/feed.xml" rel="self" type="application/rss" />
    <item>
      <title>Pure CSS solution to retina images with a single file</title>
      <link>https://yozy.net/2018/01/pure-css-solution-to-retina-images-with-a-single-file/</link>
      <pubDate>Wed, 03 Jan 2018 10:20:50 +0100</pubDate>
      <guid>https://yozy.net/2018/01/pure-css-solution-to-retina-images-with-a-single-file/</guid>
      <description>&lt;p&gt;Problem: You have an image and want it to display well in browsers on a high DPI display. There are many ways to do this, some of them &lt;a href=&#34;http://mir.aculo.us/2012/06/26/flowchart-how-to-retinafy-your-website/&#34;&gt;more complicated&lt;/a&gt; than &lt;a href=&#34;http://brianflove.com/2014/08/07/retina-display-images/&#34;&gt;others&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My requirements were pretty simple:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want to be able to publish &amp;ldquo;retina&amp;rdquo; images with default markdown syntax&lt;/li&gt;&#xA;&lt;li&gt;I prefer images to be blurry on non-high DPI screens, they are blurry anyway so what&amp;rsquo;s the harm.&lt;/li&gt;&#xA;&lt;li&gt;I do not care about wasted bandwidth by sending retina assets to clients with standard definition screens. Not having ads or huge javascript on this site makes up for this.&lt;/li&gt;&#xA;&lt;li&gt;I do not want to use any javascript or server side hacks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So what&amp;rsquo;s the solution?&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Name @2x assets with &lt;code&gt;@2x&lt;/code&gt; in their filename, for example &lt;a href=&#34;mailto:image@2x.png&#34;&gt;image@2x.png&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add this small snippet into my CSS file (thanks, Internet Explorer!)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*=&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;@2x&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;zoom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For an example usage look at my &lt;a href=&#34;https://yozy.net/2018/01/qt-creator-hidden-gems/&#34;&gt;article about Qt Creator&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
