Note that there are some explanatory texts on larger screens.

plurals
  1. POResponsive image grid. Fill in the blanks on wrap
    text
    copied!<p>Here is a responsive image grid I've made;</p> <p><a href="http://jsfiddle.net/robflate/kMnJH/" rel="nofollow">http://jsfiddle.net/robflate/kMnJH/</a></p> <p>When the grid resizes (upon browser resize) or when there are a certain number of images in the grid, it leaves empty gaps. I want to know if there is anything I can do, perhaps using jQuery, to fill in the gaps with an image of my choosing. See the image below for what I mean, it shows a holder image with a diagonal line through it. This is purely for aesthetic reasons.</p> <p><a href="http://cl.ly/Dql6" rel="nofollow">http://cl.ly/Dql6</a></p> <p>Here is the code from the jsfiddle;</p> <pre><code>&lt;!doctype html&gt; &lt;head&gt; &lt;style type="text/css"&gt; ul { margin: 0; padding: 0; } figure { margin: 0; padding: 0; } #page { margin: 0 auto; max-width: 1000px; } .item { display:block; position:relative; float:left; overflow:hidden; width: 20%; } img { max-width:100% !important; height:auto !important; width: auto; border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } .name a { display:inline; text-decoration: underline; position:relative; } @media (max-width: 800px) { .item { width: 25%; } } @media (max-width: 600px) { .item { width: 33.33%; } } @media (max-width: 400px) { .item { width: 50%; } } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="page"&gt; &lt;div id="gallery"&gt; &lt;a href="http://google.com/"&gt; &lt;figure class="item"&gt; &lt;img src="http://f.cl.ly/items/1N030m2a1g2U260e0A1e/sony_ps3-21-200x200.jpg" width="200" height="200"&gt; &lt;/figure&gt; &lt;/a&gt; &lt;a href="http://google.com/"&gt; &lt;figure class="item"&gt; &lt;img src="http://f.cl.ly/items/1N030m2a1g2U260e0A1e/sony_ps3-21-200x200.jpg" width="200" height="200"&gt; &lt;/figure&gt; &lt;/a&gt; &lt;a href="http://google.com/"&gt; &lt;figure class="item"&gt; &lt;img src="http://f.cl.ly/items/1N030m2a1g2U260e0A1e/sony_ps3-21-200x200.jpg" width="200" height="200"&gt; &lt;/figure&gt; &lt;/a&gt; &lt;a href="http://google.com/"&gt; &lt;figure class="item"&gt; &lt;img src="http://f.cl.ly/items/1N030m2a1g2U260e0A1e/sony_ps3-21-200x200.jpg" width="200" height="200"&gt; &lt;/figure&gt; &lt;/a&gt; &lt;a href="http://google.com/"&gt; &lt;figure class="item"&gt; &lt;img src="http://f.cl.ly/items/1N030m2a1g2U260e0A1e/sony_ps3-21-200x200.jpg" width="200" height="200"&gt; &lt;/figure&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload