Skip to content

Instantly share code, notes, and snippets.

@nwtn
Last active October 12, 2015 17:28
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nwtn/4062299 to your computer and use it in GitHub Desktop.
picture fallbacks (object, embed, img)
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>&lt;picture&gt; with different fallbacks</title>
</head>
<body>
<h1>&lt;picture&gt; with different fallbacks</h1>
<p>Don't forget to check which resources are loaded, regardless of what is displayed.</p>
<h2>Test 1: &lt;object&gt;</h2>
<picture alt="1a">
<source src="http://responsiveimages.org/img/logo.png" alt="1b">
<object type="image/jpeg" data="http://placekitten.com/600/220"></object>
</picture>
<ul>
<li>RICG logo = Support for &lt;picture&gt;</li>
<li>Kitten = Support for image in &lt;embed&gt; src</li>
<li>Nothing = No support</li>
</ul>
<h2>Test 2: &lt;embed&gt;</h2>
<picture>
<source src="http://responsiveimages.org/img/logo.png">
<embed type="image/jpeg" src="http://placekitten.com/600/221">
</picture>
<ul>
<li>RICG logo = Support for &lt;picture&gt;</li>
<li>Kitten = Support for image in &lt;embed&gt; src</li>
<li>Nothing = No support</li>
</ul>
<h2>Test 3: &lt;object&gt; and &lt;embed&gt;</h2>
<picture>
<source src="http://responsiveimages.org/img/logo.png">
<object type="image/jpeg" data="http://placekitten.com/600/222">
<embed type="image/jpeg" src="http://placekitten.com/600/223">
</object>
</picture>
<ul>
<li>RICG logo = Support for &lt;picture&gt;</li>
<li>Kitten = Support for image in &lt;embed&gt; src, within an &lt;object&gt;</li>
<li>Nothing = No support</li>
</ul>
<h2>Test 4: &lt;object&gt; and &lt;img&gt;</h2>
<picture>
<source src="http://responsiveimages.org/img/logo.png">
<object type="image/jpeg" data="http://placekitten.com/600/224">
<img src="http://placekitten.com/600/225" alt="kitten">
</object>
</picture>
<ul>
<li>RICG logo = Support for &lt;picture&gt;</li>
<li>Kitten = Support &lt;img&gt; within an &lt;object&gt;</li>
<li>Nothing = No support</li>
</ul>
<h2>Test 5: &lt;img&gt;</h2>
<picture>
<source src="http://responsiveimages.org/img/logo.png">
<img src="http://placekitten.com/600/226" alt="kitten">
</picture>
<ul>
<li>RICG logo = Support for &lt;picture&gt;</li>
<li>Kitten = Support &lt;img&gt;</li>
<li>Nothing = No support</li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment