this is the page that I copied your demo from http://fofwebdesign.co.uk/template/_...img-rwd-03.htm
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="description" lang="en" content="A responsive grid of images that scale fluidly to fill any size viewport. Media queries alter the number of images per row for more comfortable viewing and smaller screen sizes."/>
<title>CSS3 Grid Images - Fluid Scale, Responsive</title>
<!-- http://www.dynamicdrive.com/forums/archive/index.php/t-77355.html -->
<style>
html, body { margin:0; padding:0; font:16px/1.75 Verdana, Arial, Helvetica, sans-serif; background:#ccc }
#header { position:relative; top:0; left:0; right:0; height:4.0625em; background:#222 }
.page-content { padding:0 1em 1em; max-width:64em; margin:auto; background:#fff }
.breadcrumbs { font-size:.75em; border-bottom:7px solid #eee; margin:0 -1.25em 1.5em; padding:1em 1.25em }
.breadcrumbs span { display:none }
@media(min-width:30em) { .breadcrumbs { line-height:3.75; padding:0 1.25em } }
@media(min-width:60em) { .breadcrumbs span { display:inline-block } }
a, a:active, a:visited { color:#c30 }
a:visited { color:#c90 }
a:hover, a:focus { color:#666; text-decoration:none }
table { margin:1em 0 }
td { font-weight:bold }
td, input { text-align:center }
.right { text-align:right }
.left { text-align:left }
.clearfix:after { content:" "; display:table; clear:both }
/* #### - reduce padding-bottom for rectangular images (75% = 4:3 aspect ratio, 56.25% = 16:9 aspect ratio) - #### */
.img { max-width:100%; height:auto; width:auto\9; /* IE8 */ }
.img:hover { opacity:0.5 }
/* #### - smallest width = 2 images per row - #### */
.grid-outer { margin:-0.75% } /* negative value of .grid margin */
.grid { float:left; margin:0.75%; width:15.166% } /* width = (100 / images per row) - ( margin x 2 ) */
</style>
</head>
<body>
<div id="header">
<a href="/"><img src="/template/images/logo-50x50.png" style="position:absolute; top:0.5em; left:1em; width:3em; height:3em; border:0" alt="Home" title="Home"/></a>
<span style="position:absolute; top:1.175em; left:5em; color:#fff">Focus on Function</span>
</div><!-- closing "#header" -->
<div class="page-content">
<p class="breadcrumbs"><span>You are here:</span> <a href="/">Home</a> / <a href="/freebies-for-websites.php">Freebies For Websites</a> / <a href="/freebies-for-websites/demos-and-snippets.php">Demos & Snippets</a></p>
<h2>CSS3 Grid Images - Fluid Scale, Responsive</h2>
<p>The images in this demo fluidly scale down in size as the browser width decreases.</p>
<p>Standard <img> tags are not constrained to the grid which allows them to flow around differently sized neighbours. This may not be desirable behaviour, so here's a <a href="grid-img-rwd-02.htm">demo using background-images</a> that counters that.</p>
<br/>
<div class="grid-outer clearfix">
<div class="grid">
<img src="/userfiles/images/portfolio/web-templates/small/jemcon.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/userfiles/images/portfolio/graphics-logos/small/fof-logo.png" class="img" alt=""/>
</div>
<div class="grid">
<img src="_images/pic1.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="_images/pic2.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="_images/thistle.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/template/images/beverley-hooton-x2.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="http://fast-edit.co.uk/demo1/userfiles/images/bees.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - those pants - front.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - Minx Rio & Jem again.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - Minx saunters.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - One Pizzazz Too Many.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - loves young dream.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - down with the 80s.JPG" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - he is mine Jem.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - mini Misfits.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - nasty Jetta & Roxy.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - sexy Pizzazz!.jpg" class="img" alt=""/>
</div>
<div class="grid">
<img src="/freebies-for-websites/php/gallery/small/Cosplay - sexy Roxy.jpg" class="img" alt=""/>
</div>
</div>
<ul>
<li><a href="grid-img-rwd.htm">Back to demo using 'background-size:cover'</a></li>
</ul>
<h2>More demos and snippets</h2>
<p>Did you find this useful? There are more <a href="/freebies-for-websites/demos-and-snippets.php">demos and code snippets</a> this way.</p>
</div><!-- closing ".page-content" -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
/* })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); */
})(window,document,'script','//fofwebdesign.co.uk/template/scripts/ga.php','ga');
ga('create', 'UA-33863475-1', 'fofwebdesign.co.uk');
ga('send', 'pageview');
</script>
</body>
</html>
I only made changes to this part of the code
Code:
<style>
/* #### - reduce padding-bottom for rectangular images (75% = 4:3
aspect ratio, 56.25% = 16:9 aspect ratio) - #### */
.img { max-width:100%; height:auto; width:auto\9; /* IE8 */ }
.img:hover { opacity:0.5 }
/* #### - smallest width = 2 images per row - #### */
.grid-outer { margin:-0.75% } /* negative value of .grid margin */
.grid { float:left; margin:0.75%; width:15.166% } /* width = (100 /
images per row) - ( margin x 2 ) */
</style>
Bookmarks