<div class="codetitle"> <span><a style="CURSOR: pointer" data="66439" class="copybut" id="copybut66439" onclick="doCopy('code66439')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code66439"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><head> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>瀑布流布局代码</title> <br><script type="text/javascript" src="js/jquery.js"></script> <br><style type="text/css"> <br>body, div, img, h1, h2, h3, h4, h5, h6 { padding:0px; margin:0px; } <br>img { border:none; } <br>.wrapper { width:960px; margin:0 auto; } <br>#con1_1 { position:relative; } <br>#con1_1 .product_list { position:absolute; left:0px; top:0px; padding:10px; background:#eee; } <br>.product_list img { width:200px; display:block; } <br>.product_list h2 { padding:5px 0px; font-size:12px; text-align:center; color:#333; } <br></style> <br></head> <br><body> <br><div class="wrapper"> <br><h3>这是正文的标题部分</h3> <br><div id="con1_1"> <br><div class="product_list"> <a href="#"><img src="images/img1.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img2.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img3.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img4.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img5.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img6.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img7.jpg"></a> <br><h2>图片高度</h2> <br></div> <br><div class="product_list"> <a href="#"><img src="images/img8.jpg"></a> <br><h2>图片高度</h2> <br></div> <br></div> <br><h3>这行文字的位置首先要用js去计算下上面内容的高度了</h3> <br></div> <br> </div>