html - CSS/jQuery image grid layout -
i have read many threads image grid layouts using jquery or sole css, mine little bit different have read using columns differing widths.
i purposely not pasting code @ point due fact have tried various different methods code seems no longer 'nice'.
as can see page: http://tinyurl.com/poxn4un - trying acheive images (in our work section) laid out how bottom 2 slotting nicely between 2 edge images.
i have tried masonry no success , tried flexbox in use @ point. appreciated wish learn other projects.
thanks, adrian
you use flex-box combination layout this.
here's example:
jsfiddle example
and here's css , html powering it:
* { box-sizing: border-box; } .bricks { display: flex; height: 450px; flex-direction: row; } .bricks > * { border: solid 1px #222; } .sidebar { flex: 0 0 220px; background-image: url(https://placehold.it/220x450/075883); } .center-contain { flex: 0 0 402px; font-size: 0; } .center { display: inline-block; background-image: url(https://placehold.it/200x225); border: solid 1px #e5e5e5; height: 225px; } .center.m { width: 200px; } .center.lg { width: 300px; } .center.sm { width: 100px; }
<div class='bricks'> <div class='sidebar sidebar-left'></div> <div class='center-contain'> <div class='center sm'></div> <div class='center lg'></div> <div class='center m'></div> <div class='center m'></div> </div> <div class='sidebar sidebar-right'></div> </div>
Comments
Post a Comment