Skip to content

Instantly share code, notes, and snippets.

@paingpyi
Created April 23, 2013 04:25
Show Gist options
  • Save paingpyi/5440841 to your computer and use it in GitHub Desktop.
Save paingpyi/5440841 to your computer and use it in GitHub Desktop.
Maintaining images in a grid view with uniform width and height without forcing/stretching each images with fixed width and height. The main ingredients are "picasa-image" should be "block" with fixed width/height and overflow 'hidden'. Then child images should have min-width & min-height so images are not stretched even though they may have lon…
<li class="picasa-image">
<a class="picasa-image-large" href="http://lh6.ggpht.com/-f_ywI3XJxmg/SxqjI5ZAWBI/AAAAAAAAD18/ByMLDXTzxVA/DSC_5180.JPG">
<img class="picasa-image-thumb lazy" src="http://lh6.ggpht.com/-f_ywI3XJxmg/SxqjI5ZAWBI/AAAAAAAAD18/ByMLDXTzxVA/s144/DSC_5180.JPG">
</a>
</li>
<style>
.picasa-image{
border: 3px solid white;
overflow:hidden;
width: 130px;
height: 100px;
display: block;
}
.picasa-image-thumb{
min-width: 130px;
min-height: 90px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment