Login / Join
Masonry Css grid simple example
submitted on 29/01/2016 by
Codicode
+ infos
Config
Embed
Share
Masonry Css grid simple example
by
Codicode
a simple implementation of the Masonry Css grid, the cascading grid layout library
Framework 1 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
Framework 2 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
+ Js file(s) :
https://npmcdn.com/masonry-layout@4.0/dist/masonry.pkgd.min.js
+ Css file(s) :
Apply
Link :
Direct http link :
Fork button :
Html code :
Embed preview :
Copy the following html code to your page to embed the preview,
To include many previews on a single page, just repeat the first line.
You can change the width, height and border color (bcolor).
<div class="refork-widget" code="24c" style="width:100%;height:200px;" bcolor="#ccc"></div>
<script type="text/javascript" src="//snippet.run/d/z.js"></script>
HTML
<div class="grid"> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> <div class="grid-item width2"> <img src="http://www.slapix.com/img/i2/i_dont_like_the_gift.jpg" /> </div> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd dHello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd dHello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd dHello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd dHello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd dHello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> <div class="grid-item"> <img src="http://www.slapix.com/img/i2/do_i_know_right_from_wrong.jpg" /> </div> <div class="grid-item">Hello mmr odfdsf sdof ksdf sdf sfs df<br/>sf dsfsdf sd d</div> </div>
CSS
body{ color:#fff; background-color:#000; } img{ width:100%; } .grid-item { width:200px; background-color:red; } .grid-item.width2 { width:400px; }
Javascript
$('.grid').masonry({ // options itemSelector: '.grid-item', columnWidth: 200 });
©2013 Copyright snippet.run
Privacy
-
Terms of use
-
About
-
Contact