Div对齐浮动:左 [英] Div Alignment with float:left
问题描述
你好,
基本设计问题:
这是css
Hello,
basic design question:
Here is the css
.common_div>DIV{
display:block;
float:left;
border:1px solid gold;
margin:5px;
background:#AADDFF;
padding:5px;
border-radius:5px;
box-shadow: 5px 5px 2px #888888;
}
.newLine{
clear:both;
}
这里是HTML(样本)
here is the HTML(sample)
<DIV class='common_div' style='width:100%'>
<?php
for($i=0;$i<20;$i++)
?>
<DIV>Google is not helping me enough</DIV>
<?php
}
?>
<DIV class='newLine'> <DIV>
<DIV>
entire body
</DIV>
现在,上面带有common_div类的div正在创建多行。但是我想要放下的下一个DIV预计会在完成第一个div后立即开始。但事实上,在具有common_div类的div之后的div是重叠的并且是在一条物理线之后创建的。应该采用什么方法?
Now, the above div with common_div class is is creating multiple line. But the next DIV that I want to put is expected to start right after the finishing the first div. But as a matter of fact the div after the div with common_div class is overlapping and being created after one physical line. What should be the proper way to achieve this?
推荐答案
i = 0;
i< 20;
i<20;
i ++)
?>
< DIV > Google对我的帮助不足< / DIV >
< ; php
}
?>
< DIV class =' newLine' > & nbsp; < DIV >
< DIV >
全身
< ; / DIV >
i++) ?> <DIV>Google is not helping me enough</DIV> <?php } ?> <DIV class='newLine'> <DIV> <DIV> entire body </DIV>
现在,上面带有common_div类的div正在创建多行。但是我想要放下的下一个DIV预计会在完成第一个div后立即开始。但事实上,在具有common_div类的div之后的div是重叠的并且是在一条物理线之后创建的。应该采用什么方法来实现这一目标?
Now, the above div with common_div class is is creating multiple line. But the next DIV that I want to put is expected to start right after the finishing the first div. But as a matter of fact the div after the div with common_div class is overlapping and being created after one physical line. What should be the proper way to achieve this?
这篇关于Div对齐浮动:左的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!