我刚刚问了这个问题' div之间不需要空间的麻烦'
现在我有一个新问题……对于我的布局,我需要将这个框乘以 8 次,如下所示:
它以前有效,但现在(在我删除高度之后)我得到了这个:
这是一个小提琴: http: //jsfiddle.net/m5t6e/ 这是代码:
HTML(重复 8 次):
<div class='image'></div>
<div class='line1'></div>
<div class='head'></div>
<div class='subBox'>
<div class='sub'></div>
<div class='price'></div>
<div class='button'></div>
</div>
<div style='clear:both;'></div>
<div class='line2'></div>
<div class='placeholder'></div>
CSS:
.headerimage {
background-color:#000;
height:273px;
left:0;
position:absolute;
right:0;
}
.box1 {
position:relative;
top:273px;
}
.produkt {
float:left;
height:318px;
position:relative;
width:224px;
}
.image {
background-color:#afeeee;
height:230px;
position:relative;
width:224px;
}
.line1 {
background-color:#000;
height:1px;
position:relative;
width:224px;
}
.head {
background-color:#eee;
height:25px;
position:relative;
width:224px;
}
.subBox {
height:50px;
position:relative;
width:224px;
}
.sub {
height:25px;
position:relative;
width:224px;
}
.price {
background-color:#847077;
float:left;
height:20px;
position:relative;
width:160px;
}
.button {
background-color:#6A5ACD;
float:left;
height:20px;
position:relative;
width:58px;
}
.line2 {
background-color:#000;
height:5px;
padding-bottom:20px;
position:relative;
width:224px;
}
.placeholder{
height:800px;
width:800px;
position:relative;
padding-top:1000px;
}