fluid.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>fluid</title>
  6. <style>
  7. * {
  8. -webkit-box-sizing: border-box;
  9. box-sizing: border-box;
  10. }
  11. .grid {
  12. background: #DDD;
  13. }
  14. /* clearfix */
  15. .grid:after {
  16. display: block;
  17. content: '';
  18. clear: both;
  19. }
  20. .grid-sizer,
  21. .grid-item {
  22. width: 25%;
  23. }
  24. .grid-item {
  25. border: 1px solid;
  26. background: #09F;
  27. height: 100px;
  28. }
  29. .grid-item--width2 { width: 50%; }
  30. .grid-item--height2 { height: 160px; }
  31. .grid-item--height3 { height: 220px; }
  32. </style>
  33. </head>
  34. <body>
  35. <h1>fluid</h1>
  36. <div class="grid">
  37. <div class="grid-sizer"></div>
  38. <div class="grid-item grid-item--width2"></div>
  39. <div class="grid-item"></div>
  40. <div class="grid-item grid-item--height3"></div>
  41. <div class="grid-item"></div>
  42. <div class="grid-item grid-item--width2 grid-item--height2"></div>
  43. <div class="grid-item"></div>
  44. <div class="grid-item"></div>
  45. <div class="grid-item grid-item--width2"></div>
  46. <div class="grid-item grid-item--height3"></div>
  47. <div class="grid-item"></div>
  48. <div class="grid-item"></div>
  49. </div>
  50. <script src="../bower_components/eventEmitter/EventEmitter.js"></script>
  51. <script src="../bower_components/eventie/eventie.js"></script>
  52. <script src="../bower_components/doc-ready/doc-ready.js"></script>
  53. <script src="../bower_components/get-style-property/get-style-property.js"></script>
  54. <script src="../bower_components/get-size/get-size.js"></script>
  55. <script src="../bower_components/jquery-bridget/jquery.bridget.js"></script>
  56. <script src="../bower_components/matches-selector/matches-selector.js"></script>
  57. <script src="../bower_components/fizzy-ui-utils/utils.js"></script>
  58. <script src="../bower_components/outlayer/item.js"></script>
  59. <script src="../bower_components/outlayer/outlayer.js"></script>
  60. <script src="../masonry.js"></script>
  61. <script>
  62. docReady( function() {
  63. window.msnry = new Masonry( '.grid', {
  64. columnWidth: '.grid-sizer',
  65. percentPosition: true
  66. });
  67. });
  68. </script>
  69. </body>
  70. </html>