0

HTML

<div id="container">
<div class="item">
  <p>AAAAAAAAA amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
  <p>Bacon ipsum dolor sit amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
</div>
<div class="item">
  <p>BBBBBBBBmet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
  <p>Bacon ipsum dolor sit amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
  <p>Bacon ipsum dolor sit amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
  <p>Bacon ipsum dolor sit amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p><p>Bacon ipsum dolor sit amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison beef frankfurter. Turducken rump capicola, spare ribs leberkas brisket pork belly ball tip ground round. Tongue strip steak beef ribs shoulder.</p>
  </div>

etc....

CSS

body {
    background-color: red;
}

.container{ width:940px; margin:0px auto;}

.item {
  width: 220px;
  margin: 10px;
  float: left;
  padding: 5px;
  background-color: white;
}

我无法弄清楚我做错了什么。我什至将默认的砌体代码粘贴到我的编辑器(http://jsfiddle.net/desandro/LDEGk/)中,它搞砸了。

http://jsfiddle.net/ntzMr/

这些是我位于 body 标记中的脚本文件(.js 文件位于根文件夹中):

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="/jquery.masonry.min.js"></script>
4

1 回答 1

1

看起来你包含的砌体库有一些问题,在为砌体库添加外部资源后,你的代码在这里工作正常。

<script src="http://masonry.desandro.com/jquery.masonry.min.js"></script>
于 2013-01-07T03:27:59.960 回答