Find and fix web accessibility issues with ease using axe DevTools Pro. Try for free!
146.2k Followers, 716 Following, 2 Posts - See Instagram photos and videos from Amalia Ulman (@amaliaulman). Puzzle Grid Theme. This theme requires a bit of strategic thinking before posting the photos, but it may be one of the best and engaging Instagram grid ideas out there. It works best when you need to make a banner for an announcement, emphasize an idea, or launch a big campaign.
Let's say you have a bunch of images you want to display, and the goal is to get them edge-to-edge on the browser window with no gaps. Just because you think that would be cool. They are of all different sizes. You don't care if they are resized, but they should maintain their aspect ratio. Like this:
Adobe mixamo. Ideally we keep it pretty chill on the markup, like:
Without any CSS at all, the images will line up in a row since they are essentially inline-block:
But that's not quite what we want. Actinium element family. Your mind might go right to some JavaScript solution. Possibly the super cool Masonry project. The problem with the JavaScript option is that it relies on the window.resize event which (to me at least) always makes pages feel sluggish (even if you are hip and do the unbouncing thing).
We can get this working the way we want it to with just CSS. What we need are vertical columns in which to place the images. That way the images will stack on top of each other, and the height issue is moot.
We could wrap equal numbers of images in floated divs, but that's not very easy to keep balanced. The trick is going to be to use Masonry CSS, where the vertical columns are made through the CSS3 property column-count
. Yeah, literally, the thing where you can set text in narrow columns automatically.
So as long as the parent with the multiple columns is as wide as the browser window (default) and the column-gap
is 0, we got it made in the shade. By setting the width of the image to 100%, they will take up exactly the width of one column.
Let's say you have a bunch of images you want to display, and the goal is to get them edge-to-edge on the browser window with no gaps. Just because you think that would be cool. They are of all different sizes. You don't care if they are resized, but they should maintain their aspect ratio. Like this:
Adobe mixamo. Ideally we keep it pretty chill on the markup, like:
Without any CSS at all, the images will line up in a row since they are essentially inline-block:
But that's not quite what we want. Actinium element family. Your mind might go right to some JavaScript solution. Possibly the super cool Masonry project. The problem with the JavaScript option is that it relies on the window.resize event which (to me at least) always makes pages feel sluggish (even if you are hip and do the unbouncing thing).
We can get this working the way we want it to with just CSS. What we need are vertical columns in which to place the images. That way the images will stack on top of each other, and the height issue is moot.
We could wrap equal numbers of images in floated divs, but that's not very easy to keep balanced. The trick is going to be to use Masonry CSS, where the vertical columns are made through the CSS3 property column-count
. Yeah, literally, the thing where you can set text in narrow columns automatically.
So as long as the parent with the multiple columns is as wide as the browser window (default) and the column-gap
is 0, we got it made in the shade. By setting the width of the image to 100%, they will take up exactly the width of one column.
Here's the CSS:
But what about when the browser window starts getting narrow? 5 columns might be great for a very large browser window but too many for a smaller browser window (5 images side-by-side might get too narrow). We can fix the problem super easily by having media queries test the browser width and adjust the number of columns accordingly.
Fannnnnncy.
Demo
Instagram Grid Design
See the Pen Seamless Responsive Photo Grid by CSS-Tricks (@css-tricks) on CodePen.
What is cool about this technique to me is that since it's pure CSS, everything happens very smooth and fast. You can resize your browser all around and watch things resize and move very quickly.
What about, you know.
Grids Instagram For Pc
So as far as browser support, it's pretty good, except IE, where it only works in 10+. Otherwise: Firefox 3.6+, Opera 11.1+, Safari 4+, Chrome 10+. Might even be a bit deeper than that.
League of legends launcher download. You might just skip a fallback because whatever it's not that bad it just has some white gaps. Or you might use the Modernizr/YepNope combo (Modernizr can test for it as csscolumns
) to load up jQuery Masonry and see what you can do with that. Or you could test for it and roll your own JS which counts the images and splits them up into equal groups and wraps floated divs around them. Whatever floats your boat.
Super cute cats!!
Totally. They are from LoremPixel. For the demo we grabbed photos in random sizes with jQuery: